use of com.intellij.openapi.fileEditor.ex.FileEditorManagerEx in project intellij-community by JetBrains.
the class ToolWindowManagerImpl method getSplittersToFocus.
private EditorsSplitters getSplittersToFocus() {
Window activeWindow = myWindowManager.getMostRecentFocusedWindow();
if (activeWindow instanceof FloatingDecorator) {
IdeFocusManager ideFocusManager = IdeFocusManager.findInstanceByComponent(activeWindow);
IdeFrame lastFocusedFrame = ideFocusManager.getLastFocusedFrame();
JComponent frameComponent = lastFocusedFrame != null ? lastFocusedFrame.getComponent() : null;
Window lastFocusedWindow = frameComponent != null ? SwingUtilities.getWindowAncestor(frameComponent) : null;
activeWindow = ObjectUtils.notNull(lastFocusedWindow, activeWindow);
}
FileEditorManagerEx fem = FileEditorManagerEx.getInstanceEx(myProject);
EditorsSplitters splitters = activeWindow != null ? fem.getSplittersFor(activeWindow) : null;
return splitters != null ? splitters : fem.getSplitters();
}
use of com.intellij.openapi.fileEditor.ex.FileEditorManagerEx in project intellij-community by JetBrains.
the class NextSplitAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
final CommandProcessor commandProcessor = CommandProcessor.getInstance();
commandProcessor.executeCommand(project, () -> {
final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
manager.setCurrentWindow(manager.getNextWindow(manager.getCurrentWindow()));
}, IdeBundle.message("command.go.to.next.split"), null);
}
use of com.intellij.openapi.fileEditor.ex.FileEditorManagerEx in project intellij-community by JetBrains.
the class NextSplitAction method update.
public void update(final AnActionEvent event) {
final Project project = event.getProject();
final Presentation presentation = event.getPresentation();
if (project == null) {
presentation.setEnabled(false);
return;
}
final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
presentation.setEnabled(toolWindowManager.isEditorComponentActive() && manager.isInSplitter() && manager.getCurrentWindow() != null);
}
use of com.intellij.openapi.fileEditor.ex.FileEditorManagerEx in project intellij-community by JetBrains.
the class ChangeSplitterOrientationAction method actionPerformed.
public void actionPerformed(final AnActionEvent event) {
final Project project = event.getProject();
final FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project);
fileEditorManager.changeSplitterOrientation();
}
use of com.intellij.openapi.fileEditor.ex.FileEditorManagerEx in project intellij-community by JetBrains.
the class CloseAllEditorsAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
CommandProcessor commandProcessor = CommandProcessor.getInstance();
commandProcessor.executeCommand(project, () -> {
final EditorWindow window = e.getData(EditorWindow.DATA_KEY);
if (window != null) {
final VirtualFile[] files = window.getFiles();
for (final VirtualFile file : files) {
window.closeFile(file);
}
return;
}
FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project);
VirtualFile selectedFile = fileEditorManager.getSelectedFiles()[0];
VirtualFile[] openFiles = fileEditorManager.getSiblings(selectedFile);
for (final VirtualFile openFile : openFiles) {
fileEditorManager.closeFile(openFile);
}
}, IdeBundle.message("command.close.all.editors"), null);
}
Aggregations