IDEA-121775 XDebugger: merge Watches and Variables in one view - do not evaluate invisible watches

This commit is contained in:
Egor.Ushakov
2016-03-18 14:04:04 +03:00
parent debf9f6363
commit faa538c902
3 changed files with 9 additions and 8 deletions
@@ -300,14 +300,11 @@ public class XWatchesViewImpl extends XVariablesView implements DnDNativeTarget,
@Override
public void processSessionEvent(@NotNull final SessionEvent event) {
if (myWatchesInVariables ||
getPanel().isShowing() ||
ApplicationManager.getApplication().isUnitTestMode()) {
if (getPanel().isShowing() || ApplicationManager.getApplication().isUnitTestMode()) {
myRebuildNeeded = false;
}
else {
myRebuildNeeded = true;
return;
}
super.processSessionEvent(event);
}
@@ -121,8 +121,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
@Override
public void selectionChanged(ContentManagerEvent event) {
Content content = event.getContent();
XDebugSessionImpl session = mySession;
if (session != null && content.isSelected() && DebuggerContentInfo.WATCHES_CONTENT.equals(ViewImpl.ID.get(content))) {
if (mySession != null && content.isSelected() && getWatchesContentId().equals(ViewImpl.ID.get(content))) {
myRebuildWatchesRunnable.run();
}
}
@@ -340,12 +339,17 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
if (component instanceof DataProvider) {
RunnerContentUi ui = RunnerContentUi.KEY.getData(((DataProvider)component));
if (ui != null) {
ui.restoreContent(tab.myWatchesInVariables ? DebuggerContentInfo.VARIABLES_CONTENT : DebuggerContentInfo.WATCHES_CONTENT);
ui.restoreContent(tab.getWatchesContentId());
}
}
}
}
@NotNull
private String getWatchesContentId() {
return myWatchesInVariables ? DebuggerContentInfo.VARIABLES_CONTENT : DebuggerContentInfo.WATCHES_CONTENT;
}
private void registerView(String contentId, @NotNull XDebugView view) {
myViews.put(contentId, view);
Disposer.register(myRunContentDescriptor, view);
@@ -42,7 +42,7 @@ public class WatchNodeImpl extends XValueNodeImpl implements WatchNode {
@NotNull WatchesRootNode parent,
@NotNull XExpression expression,
@Nullable XStackFrame stackFrame) {
super(tree, parent, expression.getExpression(), new XWatchValue(expression, stackFrame));
super(tree, parent, expression.getExpression(), new XWatchValue(expression, tree.isShowing() ? stackFrame : null));
myExpression = expression;
}