Community
Participate
Working Groups
When creating an action for the org.eclipse.ui.viewActions extension point, if the style="toggle" and a toolbarPath is specified (as opposed to a menubarPath), then the setting of state is ignored. It is always shown as false, and if you have the same action associated with both a menubar and toolbar, they are not kept in sync. My particular case is: <extension point="org.eclipse.ui.viewActions"> <viewContribution id="com.amzi.prolog.debugview.toolbar" targetID="org.eclipse.debug.ui.DebugView"> <action id="com.amzi.prolog.debugview.leashExit" label="Leash Exit Port" icon="icons/exit.gif" tooltip="Break at Exit ports" toolbarPath="emptyStepGroup" style="toggle" state="true" class="com.amzi.prolog.debug.ui.actions.LeashActionDelegate"> </action> </viewContribution> </extension>
Simon, This doesn't look like a duplicate of bug 37537 but I'm not completely sure. Can you verify?
Does this bug still persist in one of the more recent 3.0 integration builds (e.g., I20040219)?
I think so, see bug 34747
*** Bug 34747 has been marked as a duplicate of this bug. ***
(In reply to comment #0) The same issue is seen when defining an action using the actionset extension point and creating a corresponding toolbar action using an ActionbarContributor. With this setup, the toolbar is updated when the menu item is selected, but the menu item is not checked when the toolbar action is activated: <extension point="org.eclipse.ui.editors"> <editor id="com.webperformanceinc.plugin.myeditor.MyEditor" name="%editor.name" icon="icons/logo16.png" class="com.webperformanceinc.plugin.myeditor.MyEditor" contributorClass="com.webperformanceinc.plugin.myeditor.actions.MyEditor ActionbarContributor"/> </extension> <extension point="org.eclipse.ui.actionSets"> <actionSet id="com.webperformanceinc.plugin.myactionset" label="%actionset.label" visible="false"> <action id="com.webperformanceinc.plugin.myeditor.actions.EditorAction" menubarPath="edit/additions" label="%EditorAction.label" tooltip="%EditorAction.tip" icon="icons/percent.png" disabledicon="icons/percent_disabled.png" style="toggle" state="false" class="com.webperformanceinc.plugin.myeditor.actions.EditorAction"/> </actionSet> </extension> In MyEditorActionbarContributor: public void contributeToToolBar(IToolBarManager toolBarManager) { initializeActions(); for (int i=0;i<actions.length;i++) { toolBarManager.add(actions[i]); actions[i].setEnabled(true); } toolBarManager.update(false); } protected void initializeActions() { actions[0] = new EditorAction(); } In EditorAction: public int getStyle() { return IAction.AS_CHECK_BOX; }
Moving Dougs bugs
Assigning to component owner PW
This item has been fixed/superceded by the menu contribution mechanism - bug 154130