use of com.intellij.debugger.ui.tree.ValueDescriptor in project intellij-community by JetBrains.
the class JavaMarkObjectActionHandler method isMarked.
@Override
public boolean isMarked(@NotNull Project project, @NotNull AnActionEvent event) {
final DebuggerTreeNodeImpl node = DebuggerAction.getSelectedNode(event.getDataContext());
if (node == null)
return false;
final NodeDescriptorImpl descriptor = node.getDescriptor();
if (!(descriptor instanceof ValueDescriptor))
return false;
DebugProcess debugProcess = node.getTree().getDebuggerContext().getDebugProcess();
return ((ValueDescriptor) descriptor).getMarkup(debugProcess) != null;
}
use of com.intellij.debugger.ui.tree.ValueDescriptor 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() {
}
});
}
}
}
use of com.intellij.debugger.ui.tree.ValueDescriptor in project intellij-community by JetBrains.
the class InstancesTree method getSelectedReference.
@Nullable
ObjectReference getSelectedReference() {
TreePath selectionPath = getSelectionPath();
Object selectedItem = selectionPath != null ? selectionPath.getLastPathComponent() : null;
if (selectedItem instanceof XValueNodeImpl) {
XValueNodeImpl xValueNode = (XValueNodeImpl) selectedItem;
XValue valueContainer = xValueNode.getValueContainer();
if (valueContainer instanceof NodeDescriptorProvider) {
NodeDescriptor descriptor = ((NodeDescriptorProvider) valueContainer).getDescriptor();
if (descriptor instanceof ValueDescriptor) {
Value value = ((ValueDescriptor) descriptor).getValue();
if (value instanceof ObjectReference)
return (ObjectReference) value;
}
}
}
return null;
}
Aggregations