Java Code Examples for com.intellij.openapi.fileEditor.impl.EditorWindow

The following examples show how to use com.intellij.openapi.fileEditor.impl.EditorWindow. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: idea-gitignore   Source File: CloseIgnoredEditorsAction.java    License: MIT License 5 votes vote down vote up
/**
 * Obtains if editor is allowed to be closed.
 *
 * @return editor is allowed to be closed
 */
@Override
protected boolean isFileToClose(final EditorComposite editor, final EditorWindow window) {
    final Project project = window.getManager().getProject();
    final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);
    final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
    final VirtualFile fileInEditor = editor.getFile();
    return fileStatusManager != null &&
        fileStatusManager.getStatus(fileInEditor).equals(IgnoreFileStatusProvider.IGNORED) ||
        changeListManager.isIgnoredFile(fileInEditor);
}
 
Example 2
private String getTabTitle(VirtualFile file) {
    Window window = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();
    EditorWindow editorWindow = FileEditorManagerEx.getInstanceEx(project).getSplittersFor(window).getCurrentWindow();
    return EditorTabPresentationUtil.getEditorTabTitle(project, file, editorWindow);
}