Eclipse plugin Eclipse插件开发-从调试视图中的选择中提取IStackFrame对象

Eclipse plugin Eclipse插件开发-从调试视图中的选择中提取IStackFrame对象,eclipse-plugin,debugview,Eclipse Plugin,Debugview,因此,我正在开发一个Eclipse插件,并试图构建一个类似于Variables视图的视图。现在,为了从Debug视图中获取所选的StackFrame,我注册了一个IDebugContextListener,它最终会在选择的情况下调用下面列出的方法。 问题是我无法从IsStructuredSelection.getFirstElement()获取IStackFrame对象。 我还尝试为IStackframe类获取适配器。那也没用。 如果有人能告诉我从选择中获取IStackFrame对象的方法,我将

因此,我正在开发一个Eclipse插件,并试图构建一个类似于Variables视图的视图。现在,为了从Debug视图中获取所选的StackFrame,我注册了一个IDebugContextListener,它最终会在选择的情况下调用下面列出的方法。 问题是我无法从IsStructuredSelection.getFirstElement()获取IStackFrame对象。 我还尝试为IStackframe类获取适配器。那也没用。 如果有人能告诉我从选择中获取IStackFrame对象的方法,我将不胜感激

private void contextActivated(ISelection context) {
    if (context instanceof StructuredSelection) {
        System.out.println("a");
        Object data = ((StructuredSelection) context).getFirstElement();
        if (data instanceof IStackFrame) {
             System.out.println("yes");
        } else {
             System.out.println("no" + data.getClass().getName());
        }
    }
}

问题是它总是执行else部分(即使在debug视图中选择的是StackFrame)。另外,适配器方法也不起作用。

那么
data.getClass().getName()
会说什么呢?它总是打印出以下类名:“org.eclipse.cdt.dsf.ui.viewmodel.datamodel.AbstractDMVMNode.DMVMContext”我不确定如何从中获取IStackframe