From 7ffeca6f80f5cf458fe3d11477f35f1a8b1e7bc9 Mon Sep 17 00:00:00 2001 From: Vassiliy Kudryashov Date: Wed, 12 Dec 2012 13:47:41 +0400 Subject: [PATCH] http://ea.jetbrains.com/browser/ea_problems/41965 --- .../ui/layout/impl/GridCellImpl.java | 24 ++++--------------- .../ui/layout/impl/RunnerContentUi.java | 2 +- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java index e1d2ccc7042e..2230cc2bb4fc 100644 --- a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java @@ -377,10 +377,6 @@ public class GridCellImpl implements GridCell { } public void saveUiState() { - String key = getDimensionKey(); - if (key == null) - return; - saveProportions(); for (Content each : myContents.getKeys()) { @@ -393,11 +389,11 @@ public class GridCellImpl implements GridCell { final DimensionService service = DimensionService.getInstance(); final Dimension size = myContext.getContentManager().getComponent().getSize(); - service.setSize(key, size, myContext.getProject()); + service.setSize(getDimensionKey(), size, myContext.getProject()); if (myContext.getWindow() != 0) { final Window frame = SwingUtilities.getWindowAncestor(myPlaceholder); if (frame != null) { - service.setLocation(key, frame.getLocationOnScreen()); + service.setLocation(getDimensionKey(), frame.getLocationOnScreen()); } } } @@ -456,26 +452,16 @@ public class GridCellImpl implements GridCell { @Nullable public Point getLocation() { - String key = getDimensionKey(); - if (key == null) - return null; - return DimensionService.getInstance().getLocation(key, myContext.getProject()); + return DimensionService.getInstance().getLocation(getDimensionKey(), myContext.getProject()); } @Nullable public Dimension getSize() { - String key = getDimensionKey(); - if (key == null) - return null; - return DimensionService.getInstance().getSize(key, myContext.getProject()); + return DimensionService.getInstance().getSize(getDimensionKey(), myContext.getProject()); } - @Nullable private String getDimensionKey() { - Tab tab = myContainer.getTab(); - if (tab == null) - return null; - return "GridCell.Tab." + tab.getIndex() + "." + myPlaceInGrid.name(); + return "GridCell.Tab." + myContainer.getTab().getIndex() + "." + myPlaceInGrid.name(); } public boolean isValidForCalculateProportions() { diff --git a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java index 0a20452ae039..3b2a71ca0b76 100644 --- a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java +++ b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java @@ -221,7 +221,7 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac public void beforeSelectionChanged(TabInfo oldSelection, TabInfo newSelection) { if (oldSelection != null && !isStateBeingRestored()) { final GridImpl grid = getGridFor(oldSelection); - if (grid != null) { + if (grid != null && getTabFor(grid) != null) { grid.saveUiState(); } }