use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.
the class PyViewNumericContainerAction method update.
@Override
public void update(AnActionEvent e) {
e.getPresentation().setVisible(false);
TreePath[] paths = getSelectedPaths(e.getDataContext());
if (paths != null) {
if (paths.length > 1) {
e.getPresentation().setVisible(false);
return;
}
XValueNodeImpl node = getSelectedNode(e.getDataContext());
if (node != null && node.getValueContainer() instanceof PyDebugValue && node.isComputed()) {
PyDebugValue debugValue = (PyDebugValue) node.getValueContainer();
String nodeType = debugValue.getType();
if ("ndarray".equals(nodeType)) {
e.getPresentation().setText("View as Array");
e.getPresentation().setVisible(true);
} else if (("DataFrame".equals(nodeType))) {
e.getPresentation().setText("View as DataFrame");
e.getPresentation().setVisible(true);
} else {
e.getPresentation().setVisible(false);
}
} else {
e.getPresentation().setVisible(false);
}
}
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.
the class JumpToAllocationSourceAction method getStack.
@Nullable
private List<StackFrameItem> getStack(AnActionEvent e) {
final Project project = e.getProject();
final XValueNodeImpl selectedNode = getSelectedNode(e.getDataContext());
final ObjectReference ref = selectedNode != null ? getObjectReference(selectedNode) : null;
if (project == null || ref == null) {
return null;
}
final XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
if (session != null) {
final MemoryViewDebugProcessData data = DebuggerManager.getInstance(project).getDebugProcess(session.getDebugProcess().getProcessHandler()).getUserData(MemoryViewDebugProcessData.KEY);
return data != null ? data.getTrackedStacks().getStack(ref) : null;
}
return null;
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.
the class ViewAsGroup method getSelectedValues.
@NotNull
public static List<JavaValue> getSelectedValues(AnActionEvent event) {
List<XValueNodeImpl> selectedNodes = XDebuggerTreeActionBase.getSelectedNodes(event.getDataContext());
if (selectedNodes.isEmpty())
return Collections.emptyList();
List<JavaValue> res = new ArrayList<>(selectedNodes.size());
for (XValueNodeImpl node : selectedNodes) {
XValue container = node.getValueContainer();
if (container instanceof JavaValue) {
res.add((JavaValue) container);
}
}
return res;
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.
the class ViewTextAction method createCollector.
@NotNull
@Override
protected ValueCollector createCollector(@NotNull AnActionEvent e) {
XValueNodeImpl node = getStringNode(e);
return new ValueCollector(XDebuggerTree.getTree(e.getDataContext())) {
MyDialog dialog = null;
@Override
public void handleInCollector(Project project, String value, XDebuggerTree tree) {
String text = StringUtil.unquoteString(value);
if (dialog == null) {
dialog = new MyDialog(project, text, node);
dialog.setTitle(ActionsBundle.message(node != null ? "action.Debugger.ViewEditText.text" : "action.Debugger.ViewText.text"));
dialog.show();
}
dialog.setText(text);
}
};
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.
the class AdjustArrayRangeAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
if (debugProcess == null) {
return;
}
final Project project = debuggerContext.getProject();
final XValueNodeImpl node = XDebuggerTreeActionBase.getSelectedNode(e.getDataContext());
if (node == null) {
return;
}
final XValue container = node.getValueContainer();
if (!(container instanceof JavaValue)) {
return;
}
final ValueDescriptorImpl descriptor = ((JavaValue) container).getDescriptor();
ArrayRenderer renderer = getArrayRenderer(descriptor);
if (renderer == null) {
return;
}
//String title = createNodeTitle("", selectedNode);
//String label = selectedNode.toString();
//int index = label.indexOf('=');
//if (index > 0) {
// title = title + " " + label.substring(index);
//}
String title = node.getName();
final ArrayRenderer clonedRenderer = renderer.clone();
clonedRenderer.setForced(true);
if (ShowSettingsUtil.getInstance().editConfigurable(project, new NamedArrayConfigurable(title, clonedRenderer))) {
debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext()) {
@Override
public void contextAction() throws Exception {
final Renderer lastRenderer = descriptor.getLastRenderer();
if (lastRenderer instanceof ArrayRenderer) {
((JavaValue) container).setRenderer(clonedRenderer, node);
} else if (lastRenderer instanceof CompoundNodeRenderer) {
final CompoundNodeRenderer compoundRenderer = (CompoundNodeRenderer) lastRenderer;
final ChildrenRenderer childrenRenderer = compoundRenderer.getChildrenRenderer();
if (childrenRenderer instanceof ExpressionChildrenRenderer) {
ExpressionChildrenRenderer.setPreferableChildrenRenderer(descriptor, clonedRenderer);
((JavaValue) container).reBuild(node);
}
}
}
});
}
}
Aggregations