Search in sources :

Example 1 with ValueMarkerPresentationDialog

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();
}
Also used : XDebugSession(com.intellij.xdebugger.XDebugSession) XDebuggerTreeState(com.intellij.xdebugger.impl.ui.tree.XDebuggerTreeState) ValueMarkerPresentationDialog(com.intellij.xdebugger.impl.ui.tree.ValueMarkerPresentationDialog) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) XValue(com.intellij.xdebugger.frame.XValue) ValueMarkup(com.intellij.xdebugger.impl.ui.tree.ValueMarkup) XDebugSessionImpl(com.intellij.xdebugger.impl.XDebugSessionImpl)

Aggregations

XDebugSession (com.intellij.xdebugger.XDebugSession)1 XValue (com.intellij.xdebugger.frame.XValue)1 XDebugSessionImpl (com.intellij.xdebugger.impl.XDebugSessionImpl)1 ValueMarkerPresentationDialog (com.intellij.xdebugger.impl.ui.tree.ValueMarkerPresentationDialog)1 ValueMarkup (com.intellij.xdebugger.impl.ui.tree.ValueMarkup)1 XDebuggerTreeState (com.intellij.xdebugger.impl.ui.tree.XDebuggerTreeState)1 XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)1