use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.
the class XDebuggerTreeActionBase method getSelectedNode.
@Nullable
public static XValueNodeImpl getSelectedNode(final DataContext dataContext) {
XDebuggerTree tree = XDebuggerTree.getTree(dataContext);
if (tree == null)
return null;
TreePath path = tree.getSelectionPath();
if (path == null)
return null;
Object node = path.getLastPathComponent();
return node instanceof XValueNodeImpl ? (XValueNodeImpl) node : null;
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl 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