From 8ae75b60f4c307f49699336720f9f20a13c3d34d Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Tue, 31 May 2016 13:07:35 +0300 Subject: [PATCH] IDEA-156761 'Show watches in variables tab' button moves to Server tab --- .../xdebugger/impl/ui/XDebugSessionTab.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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); + } + } + } }