2

パースペクティブに基づいてツールバーにコマンドを表示したいと思います。これを実現するために、以下のようにコア式を使用しました。

   <extension point="org.eclipse.core.expressions.definitions">
      <definition id="onValidationPerspective">
         <with variable="activeWorkbenchWindow.activePerspective">
               <equals value="com.sample.perspective1"/>
          </with>
      </definition>
   </extension>

以下のようにコマンドタグでこれを使用しました。

   <command
        commandId="com.sample.run.root"
        icon="icons/run_exc.gif"
        label="Reset Card"
        style="pulldown">
      <visibleWhen checkEnabled="false">
        <reference
             definitionId="onValidationPerspective">
        </reference>
      </visibleWhen>
   </command>

上記のコードは正常に機能しています。

しかし、これを複数のパースペクティブに拡張したいと思います。つまり、ツールバーのコマンドを2つのパースペクティブ、つまりcom.sample.perspective1とで表示したいと思いますcom.sample.perspective2

コア式を使用してこれをどのように達成できますか?

4

2 に答える 2

1

OR操作要素を使用できます。

<definition id="onValidationPerspective">
    <or>
        <with ...
        <with ...
    </or>
</definition>
于 2012-04-17T14:20:42.680 に答える
1
<definition id="onValidationPerspective">
    <with variable="activeWorkbenchWindow.activePerspective">
        <or>
            <equals value="com.sample.perspective1"/>
            <equals value="com.sample.perspective2"/>
        </or>
    </with>
</definition>
于 2014-02-07T09:17:04.867 に答える