本文整理汇总了Java中com.intellij.xdebugger.evaluation.XDebuggerEvaluator.evaluate方法的典型用法代码示例。如果您正苦于以下问题:Java XDebuggerEvaluator.evaluate方法的具体用法?Java XDebuggerEvaluator.evaluate怎么用?Java XDebuggerEvaluator.evaluate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.xdebugger.evaluation.XDebuggerEvaluator
的用法示例。
在下文中一共展示了XDebuggerEvaluator.evaluate方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluateAndAct
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
private static void evaluateAndAct(Project project,
JavaStackFrame stackFrame,
StringBuilder sb,
XDebuggerEvaluator.XEvaluationCallback callback) {
XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
if (evaluator != null) {
evaluator.evaluate(XExpressionImpl.fromText(sb.toString(), EvaluationMode.CODE_FRAGMENT),
callback,
stackFrame.getSourcePosition());
}
else {
Messages.showMessageDialog(project, XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator"),
UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)),
Messages.getErrorIcon());
}
}
示例2: addWatchExpression
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public void addWatchExpression(final @Nullable XDebuggerEvaluator evaluator,
final @NotNull XExpression expression,
int index, final boolean navigateToWatchNode) {
WatchMessageNode message = evaluator != null ? WatchMessageNode.createEvaluatingNode(myTree, this, expression) : WatchMessageNode.createMessageNode(myTree, this, expression);
if (index == -1) {
myChildren.add(message);
index = myChildren.size() - 1;
}
else {
myChildren.add(index, message);
}
fireNodeInserted(index);
if (navigateToWatchNode) {
myTree.scrollPathToVisible(message.getPath());
}
if (evaluator != null) {
evaluator.evaluate(expression, new MyEvaluationCallback(message), null);
}
}
示例3: startComputingChildren
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
@Override
public void startComputingChildren() {
if (Registry.is("debugger.watches.in.variables")) {
XDebugSession session = XDebugView.getSession(getTree());
XDebuggerEvaluator evaluator = getValueContainer().getEvaluator();
if (session != null && evaluator != null) {
XDebugSessionData data = ((XDebugSessionImpl)session).getSessionData();
XExpression[] expressions = data.getWatchExpressions();
for (final XExpression expression : expressions) {
evaluator.evaluate(expression, new XDebuggerEvaluator.XEvaluationCallback() {
@Override
public void evaluated(@NotNull XValue result) {
addChildren(XValueChildrenList.singleton(expression.getExpression(), result), false);
}
@Override
public void errorOccurred(@NotNull String errorMessage) {
// do not add anything
}
}, getValueContainer().getSourcePosition());
}
}
}
super.startComputingChildren();
}
示例4: addWatchExpression
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public void addWatchExpression(final @Nullable XDebuggerEvaluator evaluator,
final @NotNull String expression,
int index, final boolean navigateToWatchNode) {
WatchMessageNode message = evaluator != null ? WatchMessageNode.createEvaluatingNode(myTree, this, expression) : WatchMessageNode.createMessageNode(myTree, this, expression);
if (index == -1) {
myChildren.add(message);
index = myChildren.size() - 1;
}
else {
myChildren.add(index, message);
}
fireNodeInserted(index);
if (navigateToWatchNode) {
myTree.scrollPathToVisible(message.getPath());
}
if (evaluator != null) {
evaluator.evaluate(expression, new MyEvaluationCallback(message), null);
}
}
示例5: evaluateAndReturn
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
private static void evaluateAndReturn(final Project project,
final JavaStackFrame stackFrame,
final DebugProcessImpl debugProcess,
XExpression expression,
final DialogWrapper dialog) {
XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
if (evaluator != null) {
evaluator.evaluate(expression,
new XDebuggerEvaluator.XEvaluationCallback() {
@Override
public void evaluated(@NotNull XValue result) {
if (result instanceof JavaValue) {
forceEarlyReturnWithFinally(((JavaValue)result).getDescriptor().getValue(),
stackFrame,
debugProcess,
dialog);
}
}
@Override
public void errorOccurred(@NotNull final String errorMessage) {
showError(project, DebuggerBundle.message("error.unable.to.evaluate.expression") + ": " + errorMessage);
}
}, stackFrame.getSourcePosition());
}
else {
showError(project, XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator"));
}
}
示例6: startEvaluation
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public void startEvaluation(@NotNull XDebuggerEvaluator.XEvaluationCallback evaluationCallback) {
final XDebuggerEditorBase inputEditor = getInputEditor();
inputEditor.saveTextInHistory();
XExpression expression = inputEditor.getExpression();
XDebuggerEvaluator evaluator = mySession.getDebugProcess().getEvaluator();
if (evaluator == null) {
evaluationCallback.errorOccurred(XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator"));
}
else {
evaluator.evaluate(expression, evaluationCallback, null);
}
}
示例7: evaluate
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
private static Pair<XValue, String> evaluate(XDebugSession session, XExpression expression, long timeout) {
XStackFrame frame = session.getCurrentStackFrame();
assertNotNull(frame);
XDebuggerEvaluator evaluator = frame.getEvaluator();
assertNotNull(evaluator);
XTestEvaluationCallback callback = new XTestEvaluationCallback();
evaluator.evaluate(expression, callback, session.getCurrentPosition());
return callback.waitFor(timeout);
}
示例8: showDebugInformation
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
private void showDebugInformation() {
final XSourcePositionWrapper wrapper = new XSourcePositionWrapper(getCurrentPosition());
final XLineBreakpoint<XBreakpointProperties> breakpoint = myBreakpoints.get(wrapper);
final XDebugSession session = getSession();
final XSuspendContext suspendContext = myStack.getSuspendContext();
if (breakpoint != null) {
final XDebuggerEvaluator evaluator = getActiveEvaluator();
final XExpression conditionExpression = breakpoint.getConditionExpression();
if (evaluator != null && conditionExpression != null) {
evaluator.evaluate(
conditionExpression,
new EvaluationCallback(breakpoint, suspendContext),
null
);
}
else if (!session.breakpointReached(breakpoint, null, suspendContext)) { // 2nd arg is printed to console when breakpoint is reached
resume();
}
}
else {
session.positionReached(suspendContext);
myTempBreakpoints.remove(wrapper);
}
TheRGraphicsUtils.getGraphicsState(session.getProject()).refresh(true);
}
示例9: startEvaluation
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public void startEvaluation(@Nonnull XDebuggerEvaluator.XEvaluationCallback evaluationCallback) {
final XDebuggerEditorBase inputEditor = getInputEditor();
inputEditor.saveTextInHistory();
XExpression expression = inputEditor.getExpression();
XDebuggerEvaluator evaluator = mySession.getDebugProcess().getEvaluator();
if (evaluator == null) {
evaluationCallback.errorOccurred(XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator"));
}
else {
evaluator.evaluate(expression, evaluationCallback, null);
}
}
示例10: computePresentation
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
@Override
public void computePresentation(@Nonnull XValueNode node, @Nonnull XValuePlace place) {
if (myStackFrame != null) {
if (myTree.isShowing() || ApplicationManager.getApplication().isUnitTestMode()) {
XDebuggerEvaluator evaluator = myStackFrame.getEvaluator();
if (evaluator != null) {
evaluator.evaluate(myExpression, new MyEvaluationCallback(node, place), myStackFrame.getSourcePosition());
}
}
}
else {
node.setPresentation(AllIcons.Debugger.Watch, EMPTY_PRESENTATION, false);
}
}
示例11: evaluate
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public static Pair<XValue, String> evaluate(XDebugSession session, String expression, long timeout) throws InterruptedException {
XDebuggerEvaluator evaluator = session.getCurrentStackFrame().getEvaluator();
XTestEvaluationCallback callback = new XTestEvaluationCallback();
evaluator.evaluate(expression, callback, session.getCurrentPosition());
return callback.waitFor(timeout);
}