Search in sources :

Example 16 with XValueNodeImpl

use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.

the class ViewTextAction method getStringNode.

private static XValueNodeImpl getStringNode(@NotNull AnActionEvent e) {
    List<XValueNodeImpl> selectedNodes = XDebuggerTreeActionBase.getSelectedNodes(e.getDataContext());
    if (selectedNodes.size() == 1) {
        XValueNodeImpl node = selectedNodes.get(0);
        XValue container = node.getValueContainer();
        if (container instanceof JavaValue && ((JavaValue) container).getDescriptor().isString() && container.getModifier() != null) {
            return node;
        }
    }
    return null;
}
Also used : JavaValue(com.intellij.debugger.engine.JavaValue) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) XValue(com.intellij.xdebugger.frame.XValue)

Example 17 with XValueNodeImpl

use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.

the class ShowInstancesByClassAction method perform.

@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
    final Project project = e.getProject();
    if (project != null) {
        final XDebugSession debugSession = XDebuggerManager.getInstance(project).getCurrentSession();
        final ObjectReference ref = getObjectReference(node);
        if (debugSession != null && ref != null) {
            final ReferenceType referenceType = ref.referenceType();
            new InstancesWindow(debugSession, l -> {
                final List<ObjectReference> instances = referenceType.instances(l);
                return instances == null ? Collections.emptyList() : instances;
            }, referenceType.name()).show();
        }
    }
}
Also used : List(java.util.List) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) StringUtil(com.intellij.openapi.util.text.StringUtil) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) ReferenceType(com.sun.jdi.ReferenceType) Project(com.intellij.openapi.project.Project) XDebuggerManager(com.intellij.xdebugger.XDebuggerManager) InstancesWindow(com.intellij.debugger.memory.ui.InstancesWindow) ObjectReference(com.sun.jdi.ObjectReference) NotNull(org.jetbrains.annotations.NotNull) XDebugSession(com.intellij.xdebugger.XDebugSession) Collections(java.util.Collections) Project(com.intellij.openapi.project.Project) XDebugSession(com.intellij.xdebugger.XDebugSession) InstancesWindow(com.intellij.debugger.memory.ui.InstancesWindow) ObjectReference(com.sun.jdi.ObjectReference) List(java.util.List) ReferenceType(com.sun.jdi.ReferenceType)

Example 18 with XValueNodeImpl

use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.

the class AdjustArrayRangeAction method update.

@Override
public void update(AnActionEvent e) {
    boolean enable = false;
    XValueNodeImpl node = XDebuggerTreeActionBase.getSelectedNode(e.getDataContext());
    if (node != null) {
        XValue container = node.getValueContainer();
        if (container instanceof JavaValue) {
            ValueDescriptorImpl descriptor = ((JavaValue) container).getDescriptor();
            enable = getArrayRenderer(descriptor) != null;
        }
    }
    e.getPresentation().setVisible(enable);
}
Also used : ValueDescriptorImpl(com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl) JavaValue(com.intellij.debugger.engine.JavaValue) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) XValue(com.intellij.xdebugger.frame.XValue)

Example 19 with XValueNodeImpl

use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.

the class XJumpToSourceActionBase method perform.

@Override
protected void perform(final XValueNodeImpl node, @NotNull final String nodeName, final AnActionEvent e) {
    XValue value = node.getValueContainer();
    final XDebuggerEvaluationDialog dialog = e.getData(XDebuggerEvaluationDialog.KEY);
    XNavigatable navigatable = sourcePosition -> {
        if (sourcePosition != null) {
            final Project project = node.getTree().getProject();
            AppUIUtil.invokeOnEdt(() -> {
                sourcePosition.createNavigatable(project).navigate(true);
                if (dialog != null && Registry.is("debugger.close.dialog.on.navigate")) {
                    dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
                }
            }, project.getDisposed());
        }
    };
    startComputingSourcePosition(value, navigatable);
}
Also used : XNavigatable(com.intellij.xdebugger.frame.XNavigatable) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) AppUIUtil(com.intellij.ui.AppUIUtil) XValue(com.intellij.xdebugger.frame.XValue) DialogWrapper(com.intellij.openapi.ui.DialogWrapper) XDebuggerEvaluationDialog(com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) Project(com.intellij.openapi.project.Project) Registry(com.intellij.openapi.util.registry.Registry) NotNull(org.jetbrains.annotations.NotNull) Project(com.intellij.openapi.project.Project) XNavigatable(com.intellij.xdebugger.frame.XNavigatable) XDebuggerEvaluationDialog(com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog) XValue(com.intellij.xdebugger.frame.XValue)

Example 20 with XValueNodeImpl

use of com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl in project intellij-community by JetBrains.

the class XSetValueAction method update.

@Override
public void update(final AnActionEvent e) {
    super.update(e);
    XValueNodeImpl node = getSelectedNode(e.getDataContext());
    Presentation presentation = e.getPresentation();
    if (node instanceof WatchNode) {
        presentation.setVisible(false);
        presentation.setEnabled(false);
    } else {
        presentation.setVisible(true);
    }
}
Also used : WatchNode(com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) Presentation(com.intellij.openapi.actionSystem.Presentation)

Aggregations

XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)22 NotNull (org.jetbrains.annotations.NotNull)7 Project (com.intellij.openapi.project.Project)6 XValue (com.intellij.xdebugger.frame.XValue)6 XDebugSession (com.intellij.xdebugger.XDebugSession)5 XDebuggerTree (com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)5 TreePath (javax.swing.tree.TreePath)5 JavaValue (com.intellij.debugger.engine.JavaValue)4 ObjectReference (com.sun.jdi.ObjectReference)3 Nullable (org.jetbrains.annotations.Nullable)3 ValueDescriptorImpl (com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl)2 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)2 XDebugSessionImpl (com.intellij.xdebugger.impl.XDebugSessionImpl)2 ResultConsumer (com.intellij.concurrency.ResultConsumer)1 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)1 SuspendContextCommandImpl (com.intellij.debugger.engine.events.SuspendContextCommandImpl)1 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)1 MemoryViewDebugProcessData (com.intellij.debugger.memory.component.MemoryViewDebugProcessData)1 InstancesWindow (com.intellij.debugger.memory.ui.InstancesWindow)1 NodeDescriptorProvider (com.intellij.debugger.ui.impl.watch.NodeDescriptorProvider)1