Examples of DBSchema


Examples of com.dci.intellij.dbn.object.DBSchema

        ConnectionHandler activeConnection = connectionMappingManager.getActiveConnection(virtualFile);
        if (activeConnection == null) {
            DBSchemaObject schemaObject = objectRef.get();
            if (schemaObject != null) {
                ConnectionHandler connectionHandler = schemaObject.getConnectionHandler();
                DBSchema schema = schemaObject.getSchema();
                connectionMappingManager.setActiveConnection(virtualFile, connectionHandler);
                connectionMappingManager.setCurrentSchema(virtualFile, schema);
            }
        }
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

        if (project != null && virtualFile != null) {
            FileConnectionMappingManager mappingManager = FileConnectionMappingManager.getInstance(project);
            ConnectionHandler activeConnection = mappingManager.getActiveConnection(virtualFile);
            visible = activeConnection != null && !activeConnection.isVirtual();
            if (visible) {
                DBSchema schema = mappingManager.getCurrentSchema(virtualFile);
                if (schema != null) {
                    text = NamingUtil.enhanceUnderscoresForDisplay(schema.getName());
                    icon = schema.getIcon();
                    enabled = true;
                }

                if (virtualFile.isInLocalFileSystem()) {
                    DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

        return objectBundle;
    }

    public DBSchema getUserSchema() {
        String userName = getUserName().toUpperCase();
        DBSchema defaultSchema = getObjectBundle().getSchema(userName);
        if (defaultSchema == null) {
            List<DBSchema> schemas = getObjectBundle().getSchemas();
            if (schemas.size() > 0) {
                return schemas.get(0);
            }
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

            for (DBSchema schema : schemas) {
                model.addElement(schema);
            }
            schemasList.setModel(model);
            DBSchema selectedSchema =
                    activeConnection == selectedConnection ? currentSchema :
                    selectedConnection.getObjectBundle().getUserSchema();
            schemasList.setSelectedValue(selectedSchema, true);
        }
    }
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

            this.connectionHandler = connectionHandler;
        }

        @Override
        public void actionPerformed(AnActionEvent e) {
            DBSchema currentSchema = connectionHandler.getUserSchema();
            file.setActiveConnection(connectionHandler);
            file.setCurrentSchema(currentSchema);

        }
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

                    mapping.setConnectionId(connectionId);
                    if (connectionHandler != null) {
                        // overwrite current schema only if the existing
                        // selection is not a valid schema for the given connection
                        String currentSchemaName = mapping.getCurrentSchema();
                        DBSchema schema = connectionHandler.isVirtual() || currentSchemaName == null ? null : connectionHandler.getObjectBundle().getSchema(currentSchemaName);
                        setCurrentSchema(virtualFile, schema);
                    }
                    return true;
                }
            }
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

                if (connectionHandler != null && !connectionHandler.isVirtual()) {
                    FileConnectionMapping mapping = lookupMapping(virtualFile);
                    if (mapping != null) {
                        String schemaName = mapping.getCurrentSchema();
                        if (StringUtil.isEmptyOrSpaces(schemaName)) {
                            DBSchema userSchema = connectionHandler.getUserSchema();
                            currentSchemaRef = userSchema == null ? null : userSchema.getRef();
                            schemaName = currentSchemaRef == null ? null : currentSchemaRef.getName();
                        } else {
                            DBSchema schema = connectionHandler.getObjectBundle().getSchema(schemaName);
                            currentSchemaRef = schema == null ? null : schema.getRef();
                        }
                        mapping.setCurrentSchema(schemaName);
                        virtualFile.putUserData(CURRENT_SCHEMA_KEY, currentSchemaRef);
                    }
                }
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

                boolean showBold = false;
                boolean isError = false;
                if (treeNode instanceof DBObject) {
                    DBObject object = (DBObject) treeNode;
                    if (object.isOfType(DBObjectType.SCHEMA)) {
                        DBSchema schema = (DBSchema) object;
                        showBold = schema.isUserSchema();
                    }

                    isError = !object.isValid();
                }
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

        if (parentTypes.size() > 0) {
            if (objectType.isSchemaObject() && connectionHandler != null && !connectionHandler.isVirtual()) {
                DBObjectBundle objectBundle = connectionHandler.getObjectBundle();

                if (filter == null || filter.acceptsCurrentSchemaObject(objectType)) {
                    DBSchema currentSchema = sourceScope.getCurrentSchema();
                    parentObjects = addObjectToSet(parentObjects, currentSchema);
                }

                if (filter == null || filter.acceptsPublicSchemaObject(objectType)) {
                    DBSchema publicSchema = objectBundle.getPublicSchema();
                    parentObjects = addObjectToSet(parentObjects, publicSchema);
                }
            }

            Set<BasePsiElement> parentObjectPsiElements = null;
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBSchema

    @Override
    public void loadFromEditor(@NotNull FileEditorStateLevel level, @NotNull TextEditor textEditor) {
        super.loadFromEditor(level, textEditor);
        content = textEditor.getEditor().getDocument().getText();
        SQLConsoleFile file = (SQLConsoleFile) DocumentUtil.getVirtualFile(textEditor.getEditor());
        DBSchema schema = file.getCurrentSchema();
        currentSchema = schema == null ? "" : schema.getName();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.