本文整理汇总了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());
}
}
示例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");
}
}
});
}
};
}
示例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);
}
}
示例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");
}
示例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);
}
}
示例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;
}
示例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());
}
示例8: CodeExecutionRequest
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
CodeExecutionRequest(String code, XDebuggerEvaluator.XEvaluationCallback callback) {
this.code = code;
this.callback = callback;
}
示例9: getCallback
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; //导入方法依赖的package包/类
public XDebuggerEvaluator.XEvaluationCallback getCallback() {
return callback;
}
示例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);