Examples of DBSchemaObject


Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

            new SimpleLaterInvocator() {
                public void execute() {
                    SimpleContent originalContent = new SimpleContent(referenceText, virtualFile.getFileType());
                    DBSourceFileContent changedContent = new DBSourceFileContent(project, virtualFile);

                    DBSchemaObject object = virtualFile.getObject();
                    if (object != null) {
                        String title =
                                object.getSchema().getName() + "." +
                                        object.getName() + " " +
                                        object.getTypeName() + " - " + windowTitle;
                        SimpleDiffRequest diffRequest = new SimpleDiffRequest(project, title);
                        diffRequest.setContents(originalContent, changedContent);
                        diffRequest.setContentTitles(referenceTitle + " ", "Your version ");

                        DiffManager.getInstance().getIdeaDiffTool().show(diffRequest);
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

    }

    public void actionPerformed(AnActionEvent e) {
        SourceCodeFile sourcecodeFile = getSourcecodeFile(e);
        if (sourcecodeFile != null) {
            DBSchemaObject object = sourcecodeFile.getObject();
            actionGroup = new DefaultActionGroup();
            actionGroup.add(new CreateDDLFileAction(object));
            actionGroup.add(new AttachDDLFileAction(object));
            actionGroup.add(new DetachDDLFileAction(object));
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

        return PROTOCOL + "://" + connectionHandler.getId();
    }

    public static String getDefaultExtension(DBObject object) {
        if (object instanceof DBSchemaObject) {
            DBSchemaObject schemaObject = (DBSchemaObject) object;
            DDLFileType ddlFileType = schemaObject.getDDLFileType(null);
            DBLanguageFileType fileType = ddlFileType == null ? SQLFileType.INSTANCE : ddlFileType.getLanguageFileType();
            return fileType.getDefaultExtension();
        }
        return "";
    }
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

            }.start();
        }
    }

    private void openChildObject(final DBObject object, ProgressIndicator progressIndicator, final boolean scroll) {
        final DBSchemaObject schemaObject = (DBSchemaObject) object.getParentObject();
        final DatabaseEditableObjectFile databaseFile = findDatabaseFile(schemaObject);
        if (!progressIndicator.isCanceled()) {
            new SimpleLaterInvocator() {

                @Override
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

                    SourceCodeFile virtualFile = getSourcecodeFile(e);
                    Editor editor = getEditor(e);
                    if (virtualFile != null && editor != null) {
                        String content = editor.getDocument().getText();
                        virtualFile.setContent(content);
                        DBSchemaObject object = virtualFile.getObject();
                        if (object != null) {
                            try {
                                SourceCodeManager sourceCodeManager = SourceCodeManager.getInstance(project);
                                String referenceText = sourceCodeManager.loadSourceCodeFromDatabase(object, virtualFile.getContentType());
                                if (!progressIndicator.isCanceled()) {
                                    openDiffWindow(e, referenceText, "Database version", "Local version vs. database version");
                                }

                            } catch (SQLException e1) {
                                MessageUtil.showErrorDialog(
                                        "Could not load sourcecode for " +
                                                object.getQualifiedNameWithType() + " from database.", e1);
                            }
                        }
                    }
                }
            }.start();
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

        Presentation presentation = e.getPresentation();
        if (virtualFile == null) {
            presentation.setEnabled(false);
        } else {

            DBSchemaObject schemaObject = virtualFile.getObject();
            if (schemaObject != null) {
                DatabaseCompatibilityInterface compatibilityInterface = DatabaseCompatibilityInterface.getInstance(schemaObject);
                if (schemaObject.getProperties().is(DBObjectProperty.COMPILABLE) &&  compatibilityInterface.supportsFeature(DatabaseFeature.OBJECT_INVALIDATION)) {
                    CompilerSettings compilerSettings = getCompilerSettings(schemaObject.getProject());
                    CompileType compileType = compilerSettings.getCompileType();
                    DBObjectStatusHolder status = schemaObject.getStatus();
                    DBContentType contentType = virtualFile.getContentType();

                    boolean isDebug = compileType == CompileType.DEBUG;
                    if (compileType == CompileType.KEEP) {
                        isDebug = status.is(contentType, DBObjectStatus.DEBUG);
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

    public DBSchema getCurrentSchema() {
        return getObject().getSchema();
    }

    public boolean preOpen() {
        DBSchemaObject object = getObject();
        if (object != null) {
            Project project = object.getProject();
            DBContentType contentType = object.getContentType();
            if (contentType == DBContentType.DATA) {
                DBDataset dataset = (DBDataset) object;
                DatasetFilterManager filterManager = DatasetFilterManager.getInstance(project);
                DatasetFilter filter = filterManager.getActiveFilter(dataset);

                if (filter == null) {
                    DataEditorSettings settings = DataEditorSettings.getInstance(project);
                    if (settings.getFilterSettings().isPromptFilterDialog()) {
                        int exitCode = filterManager.openFiltersDialog(dataset, true, false, settings.getFilterSettings().getDefaultFilterType());
                        return exitCode != DialogWrapper.CANCEL_EXIT_CODE;
                    }
                }
            }
            else if (contentType.isOneOf(DBContentType.CODE, DBContentType.CODE_SPEC_AND_BODY)) {

                DDLFileGeneralSettings ddlFileSettings = DDLFileSettings.getInstance(project).getGeneralSettings();
                ConnectionHandler connectionHandler = object.getConnectionHandler();
                boolean ddlFileBinding = connectionHandler.getSettings().getDetailSettings().isDdlFileBinding();
                if (ddlFileBinding && ddlFileSettings.getLookupDDLFilesEnabled().value()) {
                    List<VirtualFile> boundDDLFiles = getBoundDDLFiles();
                    if (boundDDLFiles == null || boundDDLFiles.isEmpty()) {
                        DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
                        List<VirtualFile> virtualFiles = fileAttachmentManager.lookupUnboundDDLFiles(object);
                        if (virtualFiles.size() > 0) {
                            int exitCode = fileAttachmentManager.showFileAttachDialog(object, virtualFiles, true);
                            return exitCode != DialogWrapper.CANCEL_EXIT_CODE;
                        } else if (ddlFileSettings.getCreateDDLFilesEnabled().value()) {
                            int exitCode = Messages.showYesNoDialog(
                                    "Could not find any DDL file for " + object.getQualifiedNameWithType() + ". Do you want to create one? \n" +
                                            "(You can disable this check in \"DDL File\" options)",
                                    Constants.DBN_TITLE_PREFIX + "No DDL file found", Messages.getQuestionIcon());
                            if (exitCode == DialogWrapper.OK_EXIT_CODE) {
                                fileAttachmentManager.createDDLFile(object);
                            }
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

        return contentFiles;
    }

    @Nullable
    public List<VirtualFile> getBoundDDLFiles() {
        DBSchemaObject object = getObject();
        if (object != null) {
            DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(object.getProject());
            if (object.getProperties().is(DBObjectProperty.EDITABLE)) {
                return fileAttachmentManager.getBoundDDLFiles(object);
            }
        }
        return null;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

    /*********************************************************
     *                     VirtualFile                       *
     *********************************************************/
    @NotNull
    public FileType getFileType() {
        DBSchemaObject object = getObject();
        DDLFileType type = object == null ? null : object.getDDLFileType(null);
        return type == null ? SQLFileType.INSTANCE : type.getLanguageFileType();
    }
View Full Code Here

Examples of com.dci.intellij.dbn.object.common.DBSchemaObject

    public DatabaseContentFile(DatabaseEditableObjectFile databaseFile, DBContentType contentType) {
        this.databaseFile = databaseFile;
        this.contentType = contentType;

        DBSchemaObject object = databaseFile.getObject();
        this.name = object.getName();
        this.path = DatabaseFileSystem.createPath(object, getContentType());
        this.url = DatabaseFileSystem.createUrl(object);

        DDLFileType ddlFileType = object.getDDLFileType(contentType);
        this.fileType = ddlFileType == null ? null : ddlFileType.getLanguageFileType();
    }
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.