Package com.intellij.openapi.fileEditor

Examples of com.intellij.openapi.fileEditor.FileEditorManager


    }

    private SourceCodeManager(Project project) {
        super(project);
        EditorActionManager.getInstance().setReadonlyFragmentModificationHandler(OverrideReadonlyFragmentModificationHandler.INSTANCE);
        FileEditorManager editorManager = FileEditorManager.getInstance(project);
        editorManager.addFileEditorManagerListener(DatabaseFileSystem.getInstance());
        editorManager.addFileEditorManagerListener(new DBLanguageFileEditorListener());
    }
View Full Code Here


                }

                OpenFileDescriptor fd = new OpenFileDescriptor(project, pairFile);

                if (fd != null) {
                    FileEditorManager manager = FileEditorManager.
                            getInstance(project);
                    Editor e = manager.openTextEditor(fd, true);
                    if (e == null) {
                        error(project,"Editor is null");
                    }
                }
                else {
View Full Code Here

            public void contentsLoaded(final ConnectionHandler connectionHandler) {
                new SimpleLaterInvocator() {
                    @Override
                    public void execute() {
                        if (!project.isDisposed()) {
                            FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
                            FileConnectionMappingManager connectionMappingManager = FileConnectionMappingManager.getInstance(project);
                            VirtualFile[] openFiles = fileEditorManager.getOpenFiles();
                            for (VirtualFile openFile : openFiles) {

                                ConnectionHandler activeConnection = connectionMappingManager.getActiveConnection(openFile);
                                if (activeConnection == connectionHandler) {
                                    FileEditor[] fileEditors = fileEditorManager.getEditors(openFile);
                                    for (FileEditor fileEditor : fileEditors) {
                                        Editor editor = null;
                                        if (fileEditor instanceof TextEditor) {
                                            TextEditor textEditor = (TextEditor) fileEditor;
                                            editor = textEditor.getEditor();
View Full Code Here

        new SimpleLaterInvocator() {
            public void execute() {
                // todo review this!!!
                SourceCodeEditor sourceCodeEditor = null;
                if (databaseFile.getContentFiles().size() > 1) {
                    FileEditorManager editorManager = FileEditorManager.getInstance(databaseFile.getProject());
                    FileEditor[] fileEditors = editorManager.getEditors(databaseFile);
                    if (fileEditors.length >= runtimeInfo.getNamespace()) {
                        FileEditor fileEditor = fileEditors[runtimeInfo.getNamespace() -1];
                        sourceCodeEditor = (SourceCodeEditor) fileEditor;
                        databaseFile.FAKE_DOCUMENT.set(sourceCodeEditor.getEditor().getDocument());
                    } else {
View Full Code Here

            new SimpleLaterInvocator() {
                @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 closeEditor(DBSchemaObject object) {
        VirtualFile virtualFile = findDatabaseFile(object);
        FileEditorManager fileEditorManager = FileEditorManager.getInstance(object.getProject());
        fileEditorManager.closeFile(virtualFile);
    }
View Full Code Here

        FileEditorManager fileEditorManager = FileEditorManager.getInstance(object.getProject());
        fileEditorManager.closeFile(virtualFile);
    }

    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);
        }
    }
View Full Code Here

            latestSelection = connectionHandler;
        }
    }

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

            }
        }
        else if (object instanceof CompilerMessageNode) {
            CompilerMessageNode compilerMessageNode = (CompilerMessageNode) object;
            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

TOP

Related Classes of com.intellij.openapi.fileEditor.FileEditorManager

Copyright © 2018 www.massapicom. 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.