Search in sources :

Example 11 with JavaValue

use of com.intellij.debugger.engine.JavaValue 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 12 with JavaValue

use of com.intellij.debugger.engine.JavaValue 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 13 with JavaValue

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

the class AutoRendererAction method actionPerformed.

public void actionPerformed(@NotNull final AnActionEvent e) {
    final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
    final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
    if (debugProcess != null) {
        final List<JavaValue> selectedValues = ViewAsGroup.getSelectedValues(e);
        if (!selectedValues.isEmpty()) {
            debugProcess.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {

                public void threadAction() {
                    for (JavaValue selectedValue : selectedValues) {
                        selectedValue.getDescriptor().setRenderer(null);
                    }
                    DebuggerAction.refreshViews(e);
                }
            });
        }
    }
}
Also used : DebugProcessImpl(com.intellij.debugger.engine.DebugProcessImpl) JavaValue(com.intellij.debugger.engine.JavaValue) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl) DebuggerContextCommandImpl(com.intellij.debugger.engine.events.DebuggerContextCommandImpl)

Example 14 with JavaValue

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

the class LocalVariableDescriptorImpl method getModifier.

@Override
public XValueModifier getModifier(JavaValue value) {
    return new JavaValueModifier(value) {

        @Override
        protected void setValueImpl(@NotNull String expression, @NotNull XModificationCallback callback) {
            final LocalVariableProxyImpl local = LocalVariableDescriptorImpl.this.getLocalVariable();
            if (local != null) {
                final DebuggerContextImpl debuggerContext = DebuggerManagerEx.getInstanceEx(getProject()).getContext();
                set(expression, callback, debuggerContext, new SetValueRunnable() {

                    public void setValue(EvaluationContextImpl evaluationContext, Value newValue) throws ClassNotLoadedException, InvalidTypeException, EvaluateException {
                        debuggerContext.getFrameProxy().setValue(local, preprocessValue(evaluationContext, newValue, local.getType()));
                        update(debuggerContext);
                    }

                    public ReferenceType loadClass(EvaluationContextImpl evaluationContext, String className) throws InvocationException, ClassNotLoadedException, IncompatibleThreadStateException, InvalidTypeException, EvaluateException {
                        return evaluationContext.getDebugProcess().loadClass(evaluationContext, className, evaluationContext.getClassLoader());
                    }
                });
            }
        }
    };
}
Also used : LocalVariableProxyImpl(com.intellij.debugger.jdi.LocalVariableProxyImpl) NotNull(org.jetbrains.annotations.NotNull) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) JavaValueModifier(com.intellij.debugger.engine.JavaValueModifier) EvaluationContextImpl(com.intellij.debugger.engine.evaluation.EvaluationContextImpl) JavaValue(com.intellij.debugger.engine.JavaValue) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl)

Example 15 with JavaValue

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

the class ArgumentValueDescriptorImpl method getModifier.

@Override
public XValueModifier getModifier(JavaValue value) {
    return new JavaValueModifier(value) {

        @Override
        protected void setValueImpl(@NotNull String expression, @NotNull XModificationCallback callback) {
            final DecompiledLocalVariable local = ArgumentValueDescriptorImpl.this.getVariable();
            if (local != null) {
                final DebuggerContextImpl debuggerContext = DebuggerManagerEx.getInstanceEx(getProject()).getContext();
                set(expression, callback, debuggerContext, new SetValueRunnable() {

                    public void setValue(EvaluationContextImpl evaluationContext, Value newValue) throws ClassNotLoadedException, InvalidTypeException, EvaluateException {
                        LocalVariablesUtil.setValue(debuggerContext.getFrameProxy().getStackFrame(), local.getSlot(), newValue);
                        update(debuggerContext);
                    }

                    public ReferenceType loadClass(EvaluationContextImpl evaluationContext, String className) throws InvocationException, ClassNotLoadedException, IncompatibleThreadStateException, InvalidTypeException, EvaluateException {
                        return evaluationContext.getDebugProcess().loadClass(evaluationContext, className, evaluationContext.getClassLoader());
                    }
                });
            }
        }
    };
}
Also used : DecompiledLocalVariable(com.intellij.debugger.jdi.DecompiledLocalVariable) NotNull(org.jetbrains.annotations.NotNull) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) JavaValueModifier(com.intellij.debugger.engine.JavaValueModifier) EvaluationContextImpl(com.intellij.debugger.engine.evaluation.EvaluationContextImpl) JavaValue(com.intellij.debugger.engine.JavaValue) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl)

Aggregations

JavaValue (com.intellij.debugger.engine.JavaValue)15 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)9 NotNull (org.jetbrains.annotations.NotNull)7 JavaValueModifier (com.intellij.debugger.engine.JavaValueModifier)5 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)5 EvaluationContextImpl (com.intellij.debugger.engine.evaluation.EvaluationContextImpl)5 ValueDescriptorImpl (com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl)5 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)4 XValue (com.intellij.xdebugger.frame.XValue)4 XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)4 DebuggerContextCommandImpl (com.intellij.debugger.engine.events.DebuggerContextCommandImpl)3 NodeRenderer (com.intellij.debugger.ui.tree.render.NodeRenderer)2 Project (com.intellij.openapi.project.Project)2 ArrayList (java.util.ArrayList)2 Modifier (com.intellij.debugger.engine.evaluation.expression.Modifier)1 SuspendContextCommandImpl (com.intellij.debugger.engine.events.SuspendContextCommandImpl)1 DecompiledLocalVariable (com.intellij.debugger.jdi.DecompiledLocalVariable)1 LocalVariableProxyImpl (com.intellij.debugger.jdi.LocalVariableProxyImpl)1 NodeRendererSettings (com.intellij.debugger.settings.NodeRendererSettings)1 UserRenderersConfigurable (com.intellij.debugger.settings.UserRenderersConfigurable)1