Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带有静态类的Eclipse RCP activeWhen表达式_Eclipse_Expression_Handler_Core_Rcp - Fatal编程技术网

带有静态类的Eclipse RCP activeWhen表达式

带有静态类的Eclipse RCP activeWhen表达式,eclipse,expression,handler,core,rcp,Eclipse,Expression,Handler,Core,Rcp,我有一节课是这样的: public class A { ... public static class B { ... } } <extension point="org.eclipse.ui.handlers"> <handler class="HandlerClass" commandId="commandId"> <activeWhe

我有一节课是这样的:

public class A {
   ...
   public static class B {
      ...
   }
}
<extension
         point="org.eclipse.ui.handlers">
      <handler
            class="HandlerClass"
            commandId="commandId">
         <activeWhen>
            <with
                  variable="selection">
               <iterate
                     ifEmpty="false">
                  <instanceof
                        value="A.B">
                  </instanceof>
               </iterate>
               <count
                     value="1">
               </count>
            </with>
         </activeWhen>
      </handler>
</extension>
我的rcp应用程序中有一个如下定义的处理程序:

public class A {
   ...
   public static class B {
      ...
   }
}
<extension
         point="org.eclipse.ui.handlers">
      <handler
            class="HandlerClass"
            commandId="commandId">
         <activeWhen>
            <with
                  variable="selection">
               <iterate
                     ifEmpty="false">
                  <instanceof
                        value="A.B">
                  </instanceof>
               </iterate>
               <count
                     value="1">
               </count>
            </with>
         </activeWhen>
      </handler>
</extension>


零件实例不起作用。我想做的是检查选择变量中的项目是否属于类型B。这可能吗?

您可以使用属性测试仪,以编程方式检查处理程序是否处于活动状态

查看此博客条目: