use of com.intellij.xdebugger.frame.XValueModifier 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());
}
});
}
}
};
}
use of com.intellij.xdebugger.frame.XValueModifier in project intellij-community by JetBrains.
the class DebuggerUIUtil method setTreeNodeValue.
public static void setTreeNodeValue(XValueNodeImpl valueNode, String text, Consumer<String> errorConsumer) {
XDebuggerTree tree = valueNode.getTree();
Project project = tree.getProject();
XValueModifier modifier = valueNode.getValueContainer().getModifier();
if (modifier == null)
return;
XDebuggerTreeState treeState = XDebuggerTreeState.saveState(tree);
valueNode.setValueModificationStarted();
modifier.setValue(text, new XValueModifier.XModificationCallback() {
@Override
public void valueModified() {
if (tree.isDetached()) {
AppUIUtil.invokeOnEdt(() -> tree.rebuildAndRestore(treeState));
}
XDebuggerUtilImpl.rebuildAllSessionsViews(project);
}
@Override
public void errorOccurred(@NotNull final String errorMessage) {
AppUIUtil.invokeOnEdt(() -> {
tree.rebuildAndRestore(treeState);
errorConsumer.consume(errorMessage);
});
XDebuggerUtilImpl.rebuildAllSessionsViews(project);
}
});
}
Aggregations