我有一个这样定义的菜单项:
<extension point="org.eclipse.ui.actionSets">
<actionSet
description="My Sample"
id="MySample.actionSet"
label="My Sample"
visible="true">
<menu
id="mysample.actionset.menu1"
label="My Sample">
<groupMarker
name="mysample.groupCreatesimilar">
</groupMarker>
</menu>
<action
class="org.mysample.actions.create.MyCreateCodeAction"
definitionId="MySample.myCreateCode.command"
id="MySample.myCreateCode.command"
label="Create Sample Code"
menubarPath="mysample.actionset.menu1/mysample.groupMarker2">
</action>
</actionSet>
</extension>
上面的 actionSet 还有很多其他的动作。我希望根据首选项变量的值启用或禁用操作(菜单)“创建示例代码”。我怎样才能做到这一点?