mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Made session nullable for "Inspect" action WEB-14691
This commit is contained in:
+21
-19
@@ -49,7 +49,7 @@ public class XInspectDialog extends DialogWrapper {
|
||||
@NotNull String name,
|
||||
@NotNull XValue value,
|
||||
XValueMarkers<?, ?> markers,
|
||||
@NotNull XDebugSession session,
|
||||
@Nullable XDebugSession session,
|
||||
boolean rebuildOnSessionEvents) {
|
||||
super(project, false);
|
||||
myRebuildOnSessionEvents = rebuildOnSessionEvents;
|
||||
@@ -58,7 +58,7 @@ public class XInspectDialog extends DialogWrapper {
|
||||
setModal(false);
|
||||
|
||||
XInstanceEvaluator instanceEvaluator = value.getInstanceEvaluator();
|
||||
if (instanceEvaluator != null && myRebuildOnSessionEvents) {
|
||||
if (instanceEvaluator != null && myRebuildOnSessionEvents && session != null) {
|
||||
Pair<XInstanceEvaluator, String> initialItem = Pair.create(instanceEvaluator, name);
|
||||
XDebuggerInstanceTreeCreator creator = new XDebuggerInstanceTreeCreator(project, editorsProvider, sourcePosition, markers, session);
|
||||
myDebuggerTreePanel = new DebuggerTreeWithHistoryPanel<Pair<XInstanceEvaluator, String>>(initialItem, creator, project, myDisposable);
|
||||
@@ -69,24 +69,26 @@ public class XInspectDialog extends DialogWrapper {
|
||||
myDebuggerTreePanel = new DebuggerTreeWithHistoryPanel<Pair<XValue, String>>(initialItem, creator, project, myDisposable);
|
||||
}
|
||||
|
||||
session.addSessionListener(new XDebugSessionAdapter() {
|
||||
@Override
|
||||
public void sessionPaused() {
|
||||
if (myRebuildOnSessionEvents) {
|
||||
myDebuggerTreePanel.rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionStopped() {
|
||||
DebuggerUIUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
close(OK_EXIT_CODE);
|
||||
if (session != null) {
|
||||
session.addSessionListener(new XDebugSessionAdapter() {
|
||||
@Override
|
||||
public void sessionPaused() {
|
||||
if (myRebuildOnSessionEvents) {
|
||||
myDebuggerTreePanel.rebuild();
|
||||
}
|
||||
});
|
||||
}
|
||||
}, myDisposable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionStopped() {
|
||||
DebuggerUIUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
close(OK_EXIT_CODE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, myDisposable);
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
+4
-7
@@ -16,7 +16,6 @@
|
||||
package com.intellij.xdebugger.impl.ui.tree.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.xdebugger.XDebugSession;
|
||||
import com.intellij.xdebugger.XDebuggerManager;
|
||||
import com.intellij.xdebugger.frame.XValue;
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
|
||||
@@ -32,11 +31,9 @@ public class XInspectAction extends XDebuggerTreeActionBase {
|
||||
protected void perform(XValueNodeImpl node, @NotNull final String nodeName, AnActionEvent e) {
|
||||
XDebuggerTree tree = node.getTree();
|
||||
XValue value = node.getValueContainer();
|
||||
XDebugSession session = XDebuggerManager.getInstance(tree.getProject()).getCurrentSession();
|
||||
if (session != null) {
|
||||
XInspectDialog dialog = new XInspectDialog(tree.getProject(), tree.getEditorsProvider(), tree.getSourcePosition(), nodeName, value,
|
||||
tree.getValueMarkers(), session, true);
|
||||
dialog.show();
|
||||
}
|
||||
XInspectDialog dialog = new XInspectDialog(tree.getProject(), tree.getEditorsProvider(), tree.getSourcePosition(), nodeName, value,
|
||||
tree.getValueMarkers(),
|
||||
XDebuggerManager.getInstance(tree.getProject()).getCurrentSession(), true);
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user