use of com.intellij.xdebugger.impl.ui.tree.ValueMarkerPresentationDialog in project intellij-community by JetBrains.
the class XMarkObjectActionHandler method perform.
@Override
public void perform(@NotNull Project project, AnActionEvent event) {
XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
if (session == null)
return;
XValueMarkers<?, ?> markers = ((XDebugSessionImpl) session).getValueMarkers();
XValueNodeImpl node = XDebuggerTreeActionBase.getSelectedNode(event.getDataContext());
if (markers == null || node == null)
return;
XValue value = node.getValueContainer();
boolean detachedView = DebuggerUIUtil.isInDetachedTree(event);
XDebuggerTreeState treeState = XDebuggerTreeState.saveState(node.getTree());
ValueMarkup existing = markers.getMarkup(value);
if (existing != null) {
markers.unmarkValue(value);
} else {
ValueMarkerPresentationDialog dialog = new ValueMarkerPresentationDialog(event.getData(CONTEXT_COMPONENT), node.getName());
dialog.show();
ValueMarkup markup = dialog.getConfiguredMarkup();
if (dialog.isOK() && markup != null) {
markers.markValue(value, markup);
}
}
if (detachedView) {
node.getTree().rebuildAndRestore(treeState);
}
session.rebuildViews();
}
Aggregations