当前位置: 首页>>代码示例>>Java>>正文


Java XDebuggerEvaluator.evaluate方法代码示例

本文整理汇总了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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PopFrameAction.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:WatchesRootNode.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:XStackFrameNode.java

示例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);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:WatchesRootNode.java

示例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"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ForceEarlyReturnAction.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:XDebuggerEvaluationDialog.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:XDebuggerTestUtil.java

示例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);
}
 
开发者ID:ktisha,项目名称:TheRPlugin,代码行数:31,代码来源:TheRDebugProcess.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:XDebuggerEvaluationDialog.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:WatchNodeImpl.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:XDebuggerTestUtil.java


注:本文中的com.intellij.xdebugger.evaluation.XDebuggerEvaluator.evaluate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。