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

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

java 1次浏览

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

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

示例1: evaluate

点赞 3

import org.eclipse.debug.core.model.IWatchExpressionDelegate; //导入依赖的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: invoke

点赞 3

import org.eclipse.debug.core.model.IWatchExpressionDelegate; //导入依赖的package包/类
public void invoke(String methodName, InvocationResult listener, String ... args) {
		IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
		StackFrameModel stackFrame = getRuntimeModel().getTopFrame();
		IWatchExpressionDelegate delegate = expressionManager.newWatchExpressionDelegate(stackFrame.getStackFrame().getModelIdentifier());

//		List<String> refPaths = getRuntimeModel().findReferencePaths(this);
//		if(refPaths.isEmpty())
//			return;

		ReferencePath refPath = getRuntimeModel().findReferencePaths(this);
		if(refPath == null)
			return;
//		String exp = refPaths.get(0) + "." + methodName + "(" + String.join(", ", args) + ")";
		String exp = refPath.referencePath + "." + methodName + "(" + String.join(", ", args) + ")";
		
//		IStackFrame context = getRuntimeModel().getFirstVisibleFrame().getStackFrame();
		delegate.evaluateExpression(exp, refPath.context, new ExpressionListener(exp, listener));
	}
 

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

示例3: displayVariable

点赞 3

import org.eclipse.debug.core.model.IWatchExpressionDelegate; //导入依赖的package包/类
/**
 * Render a selected variable.
 * 
 * @param selection
 *            the selection object
 * @param element
 *            the variable element
 * @throws DebugException
 */
private void displayVariable(IStructuredSelection selection, IDebugElement element) throws DebugException {
    IValue value = ((IVariable) element).getValue();

    if (value instanceof IJavaPrimitiveValue) {
        setBrowserTextToPrimitive((IJavaPrimitiveValue) value);
    } else {
        TreePath firstElementTreePath = ((TreeSelection) selection).getPaths()[0];
        String watchExpression = generateWatchExpression(firstElementTreePath);
        String messageExpression = generateMessageExpression(watchExpression);

        // Iterate all threads and run our rendering
        // expression in them in the hopes that we can find
        // the relevant selection in only one thread
        // FIXME find a better way to derive the correct thread!
        IWatchExpressionDelegate delegate = DebugPlugin.getDefault().getExpressionManager()
                .newWatchExpressionDelegate(element.getModelIdentifier());
        for (IThread thread : element.getDebugTarget().getThreads()) {
            delegate.evaluateExpression(messageExpression, thread, this);
        }
    }
}
 

开发者ID:danielrozenberg,
项目名称:vebugger,
代码行数:31,
代码来源:VisualDetailPane.java


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