IDEA-127739 Navigation Tab

Stage 5 NPE fix
This commit is contained in:
Vassiliy.Kudryashov
2014-09-04 21:33:56 +04:00
parent 2aea84f561
commit 910b974927
@@ -176,12 +176,9 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
public Set<EditorsSplitters> getAllSplitters() {
HashSet<EditorsSplitters> all = new LinkedHashSet<EditorsSplitters>();
if (PreviewPanel.isAvailable()) {
initUI();
EditorWindow window = myPreviewPanel.getWindow();
if (window != null) {
all.add(window.getOwner());
}
EditorWindow previewWindow = getPreviewWindow();
if (previewWindow != null) {
all.add(previewWindow.getOwner());
}
all.add(getMainSplitters());
Set<DockContainer> dockContainers = myDockManager.getContainers();
@@ -262,6 +259,13 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
}
}
@Nullable
private EditorWindow getPreviewWindow() {
if (!PreviewPanel.isAvailable()) return null;
initUI();
return myPreviewPanel.getWindow();
}
private static class MyBorder implements Border {
@Override
public void paintBorder(@NotNull Component c, @NotNull Graphics g, int x, int y, int width, int height) {
@@ -643,8 +647,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
}
if (wndToOpenIn == null || !wndToOpenIn.isFileOpen(file)) {
initUI();
EditorWindow previewWindow = PreviewPanel.isAvailable() && myPreviewPanel != null ? myPreviewPanel.getWindow() : null;
EditorWindow previewWindow = getPreviewWindow();
if (previewWindow != null) {
wndToOpenIn = previewWindow;
}