• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IWatchExpressionListener类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.eclipse.debug.core.model.IWatchExpressionListener的典型用法代码示例。如果您正苦于以下问题:Java IWatchExpressionListener类的具体用法?Java IWatchExpressionListener怎么用?Java IWatchExpressionListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IWatchExpressionListener类属于org.eclipse.debug.core.model包,在下文中一共展示了IWatchExpressionListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: evaluate

点赞 3

import org.eclipse.debug.core.model.IWatchExpressionListener; //导入依赖的package包/类
public void evaluate(String expression, InvocationResult listener) {
		IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
		StackFrameModel stackFrame = getTopFrame();
		IWatchExpressionDelegate delegate = expressionManager.newWatchExpressionDelegate(stackFrame.getStackFrame().getModelIdentifier());	
		delegate.evaluateExpression(expression, stackFrame.getStackFrame(), new IWatchExpressionListener() {
			public void watchEvaluationFinished(IWatchExpressionResult result) {
				listener.valueReturn(result.getValue());
//				setChanged();
//				notifyObservers(new Event<IStackFrameModel>(Event.Type.EVALUATION, getTopFrame()));
//				try {
//					evaluationNotify();
//				} catch (DebugException e) {
//					e.printStackTrace();
//				}
			}
		});
	}
 

开发者ID:andre-santos-pt,
项目名称:pandionj,
代码行数:18,
代码来源:RuntimeModel.java

示例2: evaluateExpression

点赞 3

import org.eclipse.debug.core.model.IWatchExpressionListener; //导入依赖的package包/类
@Override
public void evaluateExpression(String expression, IDebugElement context, IWatchExpressionListener listener) {
    this.expression = expression;
    this.context = context;
    this.listener = listener;
    if (context instanceof PyStackFrame) {

        AbstractDebugTarget target = (AbstractDebugTarget) context.getDebugTarget();
        if (target == null) {
            return; //disposed
        }

        // send the command, and then busy-wait
        EvaluateExpressionCommand cmd = new EvaluateExpressionCommand(target, expression, ((PyStackFrame) context)
                .getLocalsLocator().getPyDBLocation(), false);
        cmd.setCompletionListener(this);
        target.postCommand(cmd);

    } else {
        addError("unknown expression context");
        listener.watchEvaluationFinished(this);
    }
}
 

开发者ID:fabioz,
项目名称:Pydev,
代码行数:24,
代码来源:PyWatchExpressionDelegate.java

示例3: evaluateExpression

点赞 2

import org.eclipse.debug.core.model.IWatchExpressionListener; //导入依赖的package包/类
public void evaluateExpression(final String expression, final IDebugElement context,
    final IWatchExpressionListener listener) {
  final DebugElementImpl contextImpl = (DebugElementImpl) context;
  if (!contextImpl.getDebugTarget().isSuspended()) {
    // can only evaluate while suspended. Notify empty result.
    listener.watchEvaluationFinished(new IWatchExpressionResult() {

      public String[] getErrorMessages() {
        return EMPTY_STRINGS;
      }

      public DebugException getException() {
        return null;
      }

      public String getExpressionText() {
        return expression;
      }

      public IValue getValue() {
        return null;
      }

      public boolean hasErrors() {
        return false;
      }
    });
    return;
  }

  final EvaluateContext evaluateContext =
      (EvaluateContext) contextImpl.getAdapter(EvaluateContext.class);
  if (evaluateContext == null) {
    listener.watchEvaluationFinished(new BadWatchExpressionResult(
        new DebugException(new Status(Status.ERROR,
            ChromiumDebugUIPlugin.PLUGIN_ID,"Bad debug context")), //$NON-NLS-1$
        expression));
    return;
  }

  evaluateContext.getJsEvaluateContext().evaluateAsync(
      expression, null,
      new JsEvaluateContext.EvaluateCallback() {
        @Override
        public void success(ResultOrException result) {
          ValueBase valueBase = result.accept(new ResultOrException.Visitor<ValueBase>() {
            @Override public ValueBase visitResult(JsValue value) {
              return Value.create(evaluateContext, value,
                  ExpressionTracker.createExpressionNode(expression));
            }
            @Override
            public ValueBase visitException(JsValue exception) {
              return new ValueBase.ErrorMessageValue(evaluateContext, "<abnormal return>",
                  exception);
            }
          });
          listener.watchEvaluationFinished(new GoodWatchExpressionResult(valueBase, expression));
        }

        @Override
        public void failure(Exception cause) {
          String message = cause.getMessage();
          listener.watchEvaluationFinished(new BadWatchExpressionResult(new DebugException(
              createErrorStatus(message == null
                  ? Messages.JsWatchExpressionDelegate_ErrorEvaluatingExpression
                  : message, null)), expression));
          return;
        }
      },
      null);
}
 

开发者ID:jbosstools,
项目名称:chromedevtools,
代码行数:72,
代码来源:JsWatchExpressionDelegate.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)