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


Java XDebuggerEvaluator.XEvaluationCallback方法代码示例

本文整理汇总了Java中com.intellij.xdebugger.evaluation.XDebuggerEvaluator.XEvaluationCallback方法的典型用法代码示例。如果您正苦于以下问题:Java XDebuggerEvaluator.XEvaluationCallback方法的具体用法?Java XDebuggerEvaluator.XEvaluationCallback怎么用?Java XDebuggerEvaluator.XEvaluationCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.xdebugger.evaluation.XDebuggerEvaluator的用法示例。


在下文中一共展示了XDebuggerEvaluator.XEvaluationCallback方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getInstanceEvaluator

import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
@Nullable
@Override
public XInstanceEvaluator getInstanceEvaluator() {
  return new XInstanceEvaluator() {
    @Override
    public void evaluate(@NotNull final XDebuggerEvaluator.XEvaluationCallback callback, @NotNull final XStackFrame frame) {
      myEvaluationContext.getManagerThread().schedule(new DebuggerCommandImpl() {
        @Override
        protected void commandCancelled() {
          callback.errorOccurred(DebuggerBundle.message("error.context.has.changed"));
        }

        @Override
        protected void action() throws Exception {
          ValueDescriptorImpl inspectDescriptor = myValueDescriptor;
          if (myValueDescriptor instanceof WatchItemDescriptor) {
            Modifier modifier = ((WatchItemDescriptor)myValueDescriptor).getModifier();
            if (modifier != null) {
              NodeDescriptor item = modifier.getInspectItem(getProject());
              if (item != null) {
                inspectDescriptor = (ValueDescriptorImpl)item;
              }
            }
          }
          EvaluationContextImpl evaluationContext = ((JavaStackFrame)frame).getFrameDebuggerContext().createEvaluationContext();
          if (evaluationContext != null) {
            callback.evaluated(create(inspectDescriptor, evaluationContext, myNodeManager));
          }
          else {
            callback.errorOccurred("Context is not available");
          }
        }
      });
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:JavaValue.java

示例3: 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

示例4: evaluate

import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
@Override
public void evaluate(@NotNull DotNetStackFrameProxy stackFrameMirror,
		@NotNull DotNetDebugContext context,
		@NotNull String s,
		@Nullable PsiElement element,
		@NotNull XDebuggerEvaluator.XEvaluationCallback callback,
		@Nullable XSourcePosition sourcePosition)
{
	callback.errorOccurred("UnityScript evaluation is not supported");
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:11,代码来源:UnityScriptDebuggerProvider.java

示例5: 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

示例6: evaluateFinallyBlocks

import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
static boolean evaluateFinallyBlocks(Project project,
                              String title,
                              JavaStackFrame stackFrame,
                              XDebuggerEvaluator.XEvaluationCallback callback) {
  if (!DebuggerSettings.EVALUATE_FINALLY_NEVER.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME)) {
    List<PsiStatement> statements = getFinallyStatements(stackFrame.getDescriptor().getSourcePosition());
    if (!statements.isEmpty()) {
      StringBuilder sb = new StringBuilder();
      for (PsiStatement statement : statements) {
        sb.append("\n").append(statement.getText());
      }
      if (DebuggerSettings.EVALUATE_FINALLY_ALWAYS.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME)) {
        evaluateAndAct(project, stackFrame, sb, callback);
        return true;
      }
      else {
        int res = MessageDialogBuilder
          .yesNoCancel(title,
                       DebuggerBundle.message("warning.finally.block.detected") + sb)
          .project(project)
          .icon(Messages.getWarningIcon())
          .yesText(DebuggerBundle.message("button.execute.finally"))
          .noText(DebuggerBundle.message("button.drop.anyway"))
          .cancelText(CommonBundle.message("button.cancel"))
          .doNotAsk(
            new DialogWrapper.DoNotAskOption() {
              @Override
              public boolean isToBeShown() {
                return !DebuggerSettings.EVALUATE_FINALLY_ALWAYS.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME) &&
                       !DebuggerSettings.EVALUATE_FINALLY_NEVER.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME);
              }

              @Override
              public void setToBeShown(boolean value, int exitCode) {
                if (!value) {
                  DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME =
                    exitCode == Messages.YES ? DebuggerSettings.EVALUATE_FINALLY_ALWAYS : DebuggerSettings.EVALUATE_FINALLY_NEVER;
                }
                else {
                  DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME = DebuggerSettings.EVALUATE_FINALLY_ASK;
                }
              }

              @Override
              public boolean canBeHidden() {
                return true;
              }

              @Override
              public boolean shouldSaveOptionsOnCancel() {
                return false;
              }

              @NotNull
              @Override
              public String getDoNotShowMessage() {
                return CommonBundle.message("dialog.options.do.not.show");
              }
            })
          .show();

        switch (res) {
          case Messages.CANCEL:
            return true;
          case Messages.NO:
            break;
          case Messages.YES: // evaluate finally
            evaluateAndAct(project, stackFrame, sb, callback);
            return true;
        }
      }
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:76,代码来源:PopFrameAction.java

示例7: startEvaluation

import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public void startEvaluation(@NotNull XDebuggerEvaluator.XEvaluationCallback evaluationCallback) {
  final XDebuggerEditorBase inputEditor = myInputComponent.getInputEditor();
  inputEditor.saveTextInHistory();
  String expression = inputEditor.getText();
  myEvaluator.evaluate(expression, evaluationCallback, null, inputEditor.getMode());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:XDebuggerEvaluationDialog.java

示例8: CodeExecutionRequest

import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
CodeExecutionRequest(String code, XDebuggerEvaluator.XEvaluationCallback callback) {
    this.code = code;
    this.callback = callback;
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:5,代码来源:LuaDebuggerController.java

示例9: getCallback

import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public XDebuggerEvaluator.XEvaluationCallback getCallback() {
    return callback;
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:4,代码来源:LuaDebuggerController.java

示例10: evaluate

import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public abstract void evaluate(@NotNull DotNetStackFrameProxy frame,
@NotNull DotNetDebugContext debuggerContext,
@NotNull String expression,
@Nullable PsiElement elementAt,
@NotNull XDebuggerEvaluator.XEvaluationCallback callback,
@Nullable XSourcePosition expressionPosition);
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:7,代码来源:DotNetDebuggerProvider.java


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