Search in sources :

Example 6 with EditorsSplitters

use of com.intellij.openapi.fileEditor.impl.EditorsSplitters in project intellij-community by JetBrains.

the class ToolWindowManagerImpl method appendRequestFocusInEditorComponentCmd.

private ActionCallback appendRequestFocusInEditorComponentCmd(List<FinalizableCommand> commandList, boolean forced) {
    if (myProject.isDisposed())
        return ActionCallback.DONE;
    EditorsSplitters splitters = getSplittersToFocus();
    RequestFocusInEditorComponentCmd command = new RequestFocusInEditorComponentCmd(splitters, getFocusManager(), myCommandProcessor, forced);
    commandList.add(command);
    return command.getDoneCallback();
}
Also used : EditorsSplitters(com.intellij.openapi.fileEditor.impl.EditorsSplitters)

Example 7 with EditorsSplitters

use of com.intellij.openapi.fileEditor.impl.EditorsSplitters in project intellij-community by JetBrains.

the class FileEditorManagerEx method refreshIcons.

public void refreshIcons() {
    if (this instanceof FileEditorManagerImpl) {
        final FileEditorManagerImpl mgr = (FileEditorManagerImpl) this;
        Set<EditorsSplitters> splitters = mgr.getAllSplitters();
        for (EditorsSplitters each : splitters) {
            for (VirtualFile file : mgr.getOpenFiles()) {
                each.updateFileIcon(file);
            }
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) EditorsSplitters(com.intellij.openapi.fileEditor.impl.EditorsSplitters) FileEditorManagerImpl(com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl)

Example 8 with EditorsSplitters

use of com.intellij.openapi.fileEditor.impl.EditorsSplitters in project android by JetBrains.

the class HprofEditorFixture method findByFileName.

@NotNull
public static HprofEditorFixture findByFileName(@NotNull Robot robot, @NotNull final IdeFrameFixture frame, @NotNull final String hprofFileName) {
    HprofEditor hprofEditor = GuiQuery.getNonNull(() -> {
        FileEditor[] openEditors = null;
        FileEditorManagerImpl fileEditorManager = (FileEditorManagerImpl) FileEditorManager.getInstance(frame.getProject());
        for (EditorsSplitters splitters : fileEditorManager.getAllSplitters()) {
            for (EditorWindow window : splitters.getWindows()) {
                for (EditorWithProviderComposite editorWithProviderComposite : window.getEditors()) {
                    if (editorWithProviderComposite.getFile().getName().endsWith(hprofFileName)) {
                        if (openEditors != null) {
                            throw new ComponentLookupException(String.format("More than one Hprof editor for file '%s' found", hprofFileName));
                        }
                        openEditors = editorWithProviderComposite.getEditors();
                    }
                }
            }
        }
        if (openEditors == null) {
            throw new ComponentLookupException(String.format("Cannot find any open Hprof editors for file '%s'", hprofFileName));
        }
        HprofEditor targetEditor = null;
        for (FileEditor editor : openEditors) {
            if (editor instanceof HprofEditor) {
                if (targetEditor != null) {
                    throw new ComponentLookupException(String.format("More than one Hprof editor pane for file '%s' found", hprofFileName));
                } else {
                    targetEditor = (HprofEditor) editor;
                }
            }
        }
        return targetEditor;
    });
    return new HprofEditorFixture(robot, frame, hprofEditor);
}
Also used : EditorWithProviderComposite(com.intellij.openapi.fileEditor.impl.EditorWithProviderComposite) HprofEditor(com.android.tools.idea.editors.hprof.HprofEditor) FileEditor(com.intellij.openapi.fileEditor.FileEditor) EditorsSplitters(com.intellij.openapi.fileEditor.impl.EditorsSplitters) FileEditorManagerImpl(com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl) ComponentLookupException(org.fest.swing.exception.ComponentLookupException) EditorWindow(com.intellij.openapi.fileEditor.impl.EditorWindow) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

EditorsSplitters (com.intellij.openapi.fileEditor.impl.EditorsSplitters)8 FileEditorManagerImpl (com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl)3 EditorWithProviderComposite (com.intellij.openapi.fileEditor.impl.EditorWithProviderComposite)2 Nullable (org.jetbrains.annotations.Nullable)2 HprofEditor (com.android.tools.idea.editors.hprof.HprofEditor)1 FileEditor (com.intellij.openapi.fileEditor.FileEditor)1 FileEditorManagerEx (com.intellij.openapi.fileEditor.ex.FileEditorManagerEx)1 DockableEditorTabbedContainer (com.intellij.openapi.fileEditor.impl.DockableEditorTabbedContainer)1 EditorWindow (com.intellij.openapi.fileEditor.impl.EditorWindow)1 ModuleManager (com.intellij.openapi.module.ModuleManager)1 ModuleManagerImpl (com.intellij.openapi.module.impl.ModuleManagerImpl)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 DockContainer (com.intellij.ui.docking.DockContainer)1 ComponentLookupException (org.fest.swing.exception.ComponentLookupException)1 NotNull (org.jetbrains.annotations.NotNull)1