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;
}
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);
}
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);
}
});
}
}
}
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());
}
});
}
}
};
}
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());
}
});
}
}
};
}
Aggregations