diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java index 46c0ecc4b9e5..87b0ddba8ecc 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java @@ -330,6 +330,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { addVariablesAndWatches(mySession); attachViewToSession(mySession, myViews.get(DebuggerContentInfo.VARIABLES_CONTENT)); attachViewToSession(mySession, myViews.get(DebuggerContentInfo.WATCHES_CONTENT)); + myUi.selectAndFocus(myUi.findContent(DebuggerContentInfo.VARIABLES_CONTENT), true, false); rebuildViews(); } } @@ -340,13 +341,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { if (tab != null) { tab.toFront(false, null); // restore watches tab if minimized - JComponent component = tab.getUi().getComponent(); - if (component instanceof DataProvider) { - RunnerContentUi ui = RunnerContentUi.KEY.getData(((DataProvider)component)); - if (ui != null) { - ui.restoreContent(tab.getWatchesContentId()); - } - } + tab.restoreContent(tab.getWatchesContentId()); } } @@ -394,10 +389,21 @@ public class XDebugSessionTab extends DebuggerSessionTabBase { } private void removeContent(String contentId) { + restoreContent(contentId); //findContent returns null if content is minimized myUi.removeContent(myUi.findContent(contentId), true); XDebugView view = myViews.remove(contentId); if (view != null) { Disposer.dispose(view); } } + + private void restoreContent(String contentId) { + JComponent component = myUi.getComponent(); + if (component instanceof DataProvider) { + RunnerContentUi ui = RunnerContentUi.KEY.getData(((DataProvider)component)); + if (ui != null) { + ui.restoreContent(contentId); + } + } + } }