use of com.intellij.openapi.fileEditor.impl.EditorWindow in project intellij-community by JetBrains.
the class FormOpeningTest method getEditorComponent.
private JComponent getEditorComponent() {
FileEditorManagerEx editorManager = FileEditorManagerEx.getInstanceEx(getProject());
EditorWindow window = editorManager.getSplitters().getCurrentWindow();
return (JComponent) ((JComponent) window.getSelectedEditor().getComponent().getComponents()[0]).getComponents()[0];
}
use of com.intellij.openapi.fileEditor.impl.EditorWindow in project ideavim by JetBrains.
the class WindowGroup method closeCurrentWindow.
public void closeCurrentWindow(@NotNull DataContext context) {
final FileEditorManagerEx fileEditorManager = getFileEditorManager(context);
final EditorWindow window = fileEditorManager.getSplitters().getCurrentWindow();
if (window != null) {
window.closeAllExcept(null);
}
}
use of com.intellij.openapi.fileEditor.impl.EditorWindow in project ideavim by JetBrains.
the class WindowGroup method findWindowsInRow.
@NotNull
private static List<EditorWindow> findWindowsInRow(@NotNull EditorWindow anchor, @NotNull List<EditorWindow> windows, final boolean vertical) {
final Rectangle anchorRect = getEditorWindowRectangle(anchor);
if (anchorRect != null) {
final List<EditorWindow> result = new ArrayList<EditorWindow>();
final double coord = vertical ? anchorRect.getX() : anchorRect.getY();
for (EditorWindow window : windows) {
final Rectangle rect = getEditorWindowRectangle(window);
if (rect != null) {
final double min = vertical ? rect.getX() : rect.getY();
final double max = min + (vertical ? rect.getWidth() : rect.getHeight());
if (coord >= min && coord <= max) {
result.add(window);
}
}
}
Collections.sort(result, new Comparator<EditorWindow>() {
@Override
public int compare(EditorWindow window1, EditorWindow window2) {
final Rectangle rect1 = getEditorWindowRectangle(window1);
final Rectangle rect2 = getEditorWindowRectangle(window2);
if (rect1 != null && rect2 != null) {
final double diff = vertical ? (rect1.getY() - rect2.getY()) : (rect1.getX() - rect2.getX());
return diff < 0 ? -1 : diff > 0 ? 1 : 0;
}
return 0;
}
});
return result;
}
return Collections.singletonList(anchor);
}
use of com.intellij.openapi.fileEditor.impl.EditorWindow in project ideavim by JetBrains.
the class WindowGroup method closeAllExceptCurrent.
public void closeAllExceptCurrent(@NotNull DataContext context) {
final FileEditorManagerEx fileEditorManager = getFileEditorManager(context);
final EditorWindow current = fileEditorManager.getCurrentWindow();
for (final EditorWindow window : fileEditorManager.getWindows()) {
if (window != current) {
window.closeAllExcept(null);
}
}
}
use of com.intellij.openapi.fileEditor.impl.EditorWindow in project ideavim by JetBrains.
the class WindowGroup method selectNextWindow.
public void selectNextWindow(@NotNull DataContext context) {
final FileEditorManagerEx fileEditorManager = getFileEditorManager(context);
final EditorWindow current = fileEditorManager.getCurrentWindow();
if (current != null) {
fileEditorManager.getNextWindow(current).setAsCurrentWindow(true);
}
}
Aggregations