use of com.intellij.openapi.fileEditor.impl.DockableEditorTabbedContainer in project intellij-community by JetBrains.
the class StatusBarUtil method getCurrentFileEditor.
/**
* Finds the current file editor.
*/
@Nullable
public static FileEditor getCurrentFileEditor(@NotNull Project project, @Nullable StatusBar statusBar) {
if (statusBar == null) {
return null;
}
DockContainer c = DockManager.getInstance(project).getContainerFor(statusBar.getComponent());
EditorsSplitters splitters = null;
if (c instanceof DockableEditorTabbedContainer) {
splitters = ((DockableEditorTabbedContainer) c).getSplitters();
}
if (splitters != null && splitters.getCurrentWindow() != null) {
EditorWithProviderComposite editor = splitters.getCurrentWindow().getSelectedEditor();
if (editor != null) {
return editor.getSelectedEditorWithProvider().getFirst();
}
}
return null;
}
use of com.intellij.openapi.fileEditor.impl.DockableEditorTabbedContainer in project intellij-community by JetBrains.
the class OpenEditorsContextProvider method clearContext.
@Override
public void clearContext() {
if (myFileEditorManager != null) {
myFileEditorManager.closeAllFiles();
myFileEditorManager.getMainSplitters().clear();
}
for (DockContainer container : myDockManager.getContainers()) {
if (container instanceof DockableEditorTabbedContainer) {
container.closeAll();
}
}
}
Aggregations