Examples of DDLFileAttachmentManager


Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

            close(2);
        }
    }

    protected void doOKAction() {
        DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(object.getProject());
        Object[] selectedPsiFiles = getSelection();
        for (Object selectedPsiFile : selectedPsiFiles) {
            VirtualFile virtualFile = (VirtualFile) selectedPsiFile;
            fileAttachmentManager.bindDDLFile(object, virtualFile);
        }
        if (showLookupOption && fileForm.isDoNotPromptSelected()) {
            object.getConnectionHandler().getSettings().getDetailSettings().setDdlFileBinding(false);
        }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

            boolean isConsole = virtualFile instanceof SQLConsoleFile;
            presentation.setVisible(!isConsole);

            if (virtualFile.isInLocalFileSystem()) {
                DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
                DBSchemaObject editableObject = fileAttachmentManager.getEditableObject(virtualFile);
                if (editableObject != null) {
                    boolean isOpened = DatabaseFileSystem.getInstance().isFileOpened(editableObject);
                    presentation.setEnabled(!isOpened);
                }
            }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

                    icon = schema.getIcon();
                    enabled = true;
                }

                if (virtualFile.isInLocalFileSystem()) {
                    DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
                    DBSchemaObject editableObject = fileAttachmentManager.getEditableObject(virtualFile);
                    if (editableObject != null) {
                        boolean isOpened = DatabaseFileSystem.getInstance().isFileOpened(editableObject);
                        if (isOpened) {
                            enabled = false;
                        }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

        this.object = object;
    }

    public void actionPerformed(AnActionEvent e) {
        Project project = object.getProject();
        DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
        fileAttachmentManager.bindDDLFiles(object);
    }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

        this.object = object;
    }

    public void actionPerformed(AnActionEvent e) {
        Project project = object.getProject();
        DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
        fileAttachmentManager.detachDDLFiles(object);
    }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

    }

    public void update(AnActionEvent e) {
        Project project = ActionUtil.getProject(e);
        if (project != null) {
            DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
            boolean hasBoundDDLFiles = fileAttachmentManager.hasBoundDDLFiles(object);
            Presentation presentation = e.getPresentation();
            presentation.setEnabled(hasBoundDDLFiles);
        }
    }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

    }

    public void actionPerformed(AnActionEvent e) {
        Project project = ActionUtil.getProject(e);
        if (project != null) {
            DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
            fileAttachmentManager.createDDLFile(object);
        }
    }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

            doOKAction();
        }
    }

    protected void doOKAction() {
        DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(object.getProject());
        Object[] selectedPsiFiles = getSelection();
        for (Object selectedPsiFile : selectedPsiFiles) {
            VirtualFile virtualFile = (VirtualFile) selectedPsiFile;
            fileAttachmentManager.detachDDLFile(virtualFile);
        }
        super.doOKAction();
    }
View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

        if (virtualFile instanceof SourceCodeFile) {
            SourceCodeFile sourceCodeFile = (SourceCodeFile) virtualFile;
            return sourceCodeFile.getObject();
        }

        DDLFileAttachmentManager instance = DDLFileAttachmentManager.getInstance(getProject());
        DBSchemaObject editableObject = instance.getEditableObject(virtualFile);
        if (editableObject != null) {
            return editableObject;
        }

View Full Code Here

Examples of com.dci.intellij.dbn.ddl.DDLFileAttachmentManager

                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
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.