@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);
}
@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();
}
}
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);
@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;
}