Package com.intellij.openapi.fileEditor

Examples of com.intellij.openapi.fileEditor.FileEditorManager.openFile()


                int selectedRow = getSelectedRow();
                UncommittedChange change = (UncommittedChange) getModel().getValueAt(selectedRow, 0);
                FileEditorManager fileEditorManager = FileEditorManager.getInstance(getProject());
                VirtualFile virtualFile = VirtualFileManager.getInstance().findFileByUrl(change.getFilePath());
                if (virtualFile != null) {
                    fileEditorManager.openFile(virtualFile, true);
                }
            }

        }
    }
View Full Code Here


                }
            } else if (lastPathEntity instanceof DBObjectBundle) {
                DBObjectBundle objectBundle = (DBObjectBundle) lastPathEntity;
                ConnectionHandler connectionHandler = objectBundle.getConnectionHandler();
                FileEditorManager fileEditorManager = FileEditorManager.getInstance(connectionHandler.getProject());
                fileEditorManager.openFile(connectionHandler.getSQLConsoleFile(), true);
            }
        }
    }
   
/*    @Override
View Full Code Here

    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        FileEditorManager fileEditorManager = FileEditorManager.getInstance(connectionHandler.getProject());
        fileEditorManager.openFile(connectionHandler.getSQLConsoleFile(), true);
    }
}
View Full Code Here

                if (virtualFile != null) {
                    if (virtualFile instanceof SourceCodeFile) {
                        SourceCodeFile sourceCodeFile = (SourceCodeFile) virtualFile;
                        DatabaseEditableObjectFile databaseFile = sourceCodeFile.getDatabaseFile();
                        if (!editorManager.isFileOpen(databaseFile)) {
                            editorManager.openFile(databaseFile, requestFocus);
                        }
                        BasicTextEditor textEditor = EditorUtil.getFileEditor(databaseFile, virtualFile);
                        descriptor.navigateIn(textEditor.getEditor());
                        return;
                    }
View Full Code Here

                @Override
                public void execute() {
                    if (isFileOpened(object) || databaseFile.preOpen()) {
                        DatabaseBrowserManager.AUTOSCROLL_FROM_EDITOR.set(scroll);
                        FileEditorManager fileEditorManager = FileEditorManager.getInstance(object.getProject());
                        fileEditorManager.openFile(databaseFile, true);
                        DatabaseBrowserManager.AUTOSCROLL_FROM_EDITOR.set(true);
                    }
                }
            }.start();
        }
View Full Code Here

                @Override
                public void execute() {
                    if (isFileOpened(schemaObject) || databaseFile.preOpen()) {
                        DatabaseBrowserManager.AUTOSCROLL_FROM_EDITOR.set(scroll);
                        FileEditorManager fileEditorManager = FileEditorManager.getInstance(object.getProject());
                        FileEditor[] fileEditors = fileEditorManager.openFile(databaseFile, true);
                        for (FileEditor fileEditor : fileEditors) {
                            if (fileEditor instanceof SourceCodeMainEditor) {
                                SourceCodeMainEditor sourceCodeEditor = (SourceCodeMainEditor) fileEditor;
                                EditorUtil.selectEditor(databaseFile, fileEditor);
                                sourceCodeEditor.navigateTo(object);
View Full Code Here

    public void reopenEditor(DBSchemaObject object) {
        FileEditorManager fileEditorManager = FileEditorManager.getInstance(object.getProject());
        VirtualFile virtualFile = findDatabaseFile(object);
        if (fileEditorManager.isFileOpen(virtualFile)) {
            fileEditorManager.closeFile(virtualFile);
            fileEditorManager.openFile(virtualFile, false);
        }
    }

    public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
        if (file instanceof DatabaseEditableObjectFile) {
View Full Code Here

        }
    }

    private void openSQLConsole(ConnectionHandler connectionHandler) {
        FileEditorManager fileEditorManager = FileEditorManager.getInstance(connectionHandler.getProject());
        fileEditorManager.openFile(connectionHandler.getSQLConsoleFile(), true);
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        Project project = ActionUtil.getProject(e);
View Full Code Here

            CompilerMessage compilerMessage = compilerMessageNode.getCompilerMessage();
            FileEditorManager editorManager = FileEditorManager.getInstance(compilerMessage.getProject());

            DatabaseEditableObjectFile databaseFile = compilerMessage.getDatabaseFile();
            if (compilerMessage.isError() || editorManager.isFileOpen(databaseFile)) {
                editorManager.openFile(databaseFile, false);
                if (compilerMessage.getContentFile() != null) {
                    BasicTextEditor textEditor = EditorUtil.getFileEditor(databaseFile, compilerMessage.getContentFile());
                    if (textEditor != null) {
                        navigateInEditor(compilerMessage, textEditor, databaseFile);
                    }
View Full Code Here

                FileType tFileType = null;
                if (tVirtualFile != null) {
//                    tFileType = FileTypeManager.getInstance().getFileTypeByFile(tVirtualFile);
                    SwingUtilities.invokeLater(new Runnable() {
                         public void run() {
                             tManager.openFile(tVirtualFile, true);
                         }
                    });
                }
            } catch (MalformedURLException e) {
                log.error(e);
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.