use of com.intellij.debugger.engine.evaluation.expression.Modifier in project intellij-community by JetBrains.
the class EditSourceAction method getSourcePosition.
private static SourcePosition getSourcePosition(DebuggerTreeNodeImpl selectedNode, DebuggerContextImpl debuggerContext) {
final DebuggerContextImpl context = debuggerContext;
if (selectedNode == null || context == null) {
return null;
}
final Project project = selectedNode.getProject();
final DebuggerSession debuggerSession = context.getDebuggerSession();
if (debuggerSession == null) {
return null;
}
NodeDescriptorImpl nodeDescriptor = selectedNode.getDescriptor();
if (nodeDescriptor instanceof WatchItemDescriptor) {
Modifier modifier = ((WatchItemDescriptor) nodeDescriptor).getModifier();
if (modifier == null) {
return null;
}
nodeDescriptor = (NodeDescriptorImpl) modifier.getInspectItem(project);
}
final NodeDescriptorImpl nodeDescriptor1 = nodeDescriptor;
return ApplicationManager.getApplication().runReadAction(new Computable<SourcePosition>() {
public SourcePosition compute() {
return SourcePositionProvider.getSourcePosition(nodeDescriptor1, project, context);
}
});
}
use of com.intellij.debugger.engine.evaluation.expression.Modifier in project intellij-community by JetBrains.
the class EvaluationDescriptor method getModifier.
@Override
public XValueModifier getModifier(JavaValue value) {
return new JavaValueModifier(value) {
@Override
protected void setValueImpl(@NotNull String expression, @NotNull XModificationCallback callback) {
final EvaluationDescriptor evaluationDescriptor = EvaluationDescriptor.this;
if (evaluationDescriptor.canSetValue()) {
final DebuggerContextImpl debuggerContext = DebuggerManagerEx.getInstanceEx(getProject()).getContext();
set(expression, callback, debuggerContext, new SetValueRunnable() {
public void setValue(EvaluationContextImpl evaluationContext, Value newValue) throws ClassNotLoadedException, InvalidTypeException, EvaluateException {
final Modifier modifier = evaluationDescriptor.getModifier();
modifier.setValue(preprocessValue(evaluationContext, newValue, modifier.getExpectedType()));
update(debuggerContext);
}
public ReferenceType loadClass(EvaluationContextImpl evaluationContext, String className) throws InvocationException, ClassNotLoadedException, IncompatibleThreadStateException, InvalidTypeException, EvaluateException {
return evaluationContext.getDebugProcess().loadClass(evaluationContext, className, evaluationContext.getClassLoader());
}
});
}
}
};
}
Aggregations