メニューバーや、ツールバーにプラグインを表示させたいときはorg.eclipse.ui.IWorkbenchWindowActionDelegate を使用します。
org.eclipse.ui.actionSets
ウィザードでHello,Worldプラグインを選択すると、以下のようなplugin.xmlが出力されます。
<extension point="org.eclipse.ui.actionSets">
<actionSet label="サンプル・アクション・セット"
visible="true"
↑こうしておくと、パースペクティブのカスタマイズの
コマンドに自動的にチェックが入る
ようするにデフォルトで表示される。
id="nu.mine.kino.example.actionSet">
<menu label="サンプル・メニュー(&M)" id="sampleMenu">
<separator name="sampleGroup"></separator>
</menu>
<action label="サンプル・アクション(&S)"
icon="icons/sample.gif"
class="nu.mine.kino.example.actions.SampleAction"
tooltip="Hello, Eclipse world"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="sampleGroup"
id="nu.mine.kino.example.actions.SampleAction">
</action>
</actionSet>
</extension>
<menu label="サンプル・メニュー(&M)"
<action label="サンプル・アクション(&S)"
<actionSet label="サンプル・アクション・セット"
詳細はメニューバーを構築するにまとめました。
この記事は
現在のアクセス:10581