Search in sources :

Example 1 with DebuggerContext

use of com.intellij.debugger.DebuggerContext in project intellij-community by JetBrains.

the class ShowAllAs method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    DebuggerTreeNodeImpl selectedNode = (DebuggerTreeNodeImpl) ((DebuggerUtilsEx) DebuggerUtils.getInstance()).getSelectedNode(e.getDataContext());
    if (selectedNode == null)
        return;
    if (!isPrimitiveArray(selectedNode))
        return;
    final DebuggerContext debuggerContext = DebuggerUtils.getInstance().getDebuggerContext(e.getDataContext());
    if (debuggerContext == null || debuggerContext.getDebugProcess() == null)
        return;
    for (Enumeration children = selectedNode.children(); children.hasMoreElements(); ) {
        final DebuggerTreeNode child = (DebuggerTreeNode) children.nextElement();
        if (child.getDescriptor() instanceof ValueDescriptor) {
            debuggerContext.getDebugProcess().getManagerThread().invokeCommand(new SuspendContextCommand() {

                public SuspendContext getSuspendContext() {
                    return debuggerContext.getSuspendContext();
                }

                public void action() {
                    child.setRenderer(myRenderer);
                }

                public void commandCancelled() {
                }
            });
        }
    }
}
Also used : SuspendContextCommand(com.intellij.debugger.engine.managerThread.SuspendContextCommand) DebuggerTreeNode(com.intellij.debugger.ui.tree.DebuggerTreeNode) DebuggerTreeNodeImpl(com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl) Enumeration(java.util.Enumeration) ValueDescriptor(com.intellij.debugger.ui.tree.ValueDescriptor) DebuggerContext(com.intellij.debugger.DebuggerContext) SuspendContext(com.intellij.debugger.engine.SuspendContext)

Aggregations

DebuggerContext (com.intellij.debugger.DebuggerContext)1 SuspendContext (com.intellij.debugger.engine.SuspendContext)1 SuspendContextCommand (com.intellij.debugger.engine.managerThread.SuspendContextCommand)1 DebuggerTreeNodeImpl (com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl)1 DebuggerTreeNode (com.intellij.debugger.ui.tree.DebuggerTreeNode)1 ValueDescriptor (com.intellij.debugger.ui.tree.ValueDescriptor)1 Enumeration (java.util.Enumeration)1