Project: Eclipse_Platform_UI
Bug 178937 [Contributions] Disabled icon not shown in toolbar button for a disabled Action in ActionSet
Reported: 2007-03-23 00:02:39 | Status: verified fixed

Build ID: I20070222-0951 Actions that are defined in ActionSet extensions do not look disabled in the toolbar even though they actually are disabled (you can't click on the toolbar buttons and perform the action). Steps To Reproduce: 1.Create a new Plugin Project. In the wizard use the defaults except: (a) for "Would you like to create a rich client application?", select "no". (b) select the "Hello World" template. (2) In the manifest.xml add the required bundle " org.eclipse.core.resources" (3) In plugin.xml, add a "selection" extention for the class "org.eclipse.core.resources.IFile" to the Action "helloworld.actions.SampleAction". This will make plugin.xml looks like: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.2"?> <plugin> <extension point="org.eclipse.ui.actionSets"> <actionSet label="Sample Action Set" visible="true" id="HelloWorld.actionSet"> <menu label="Sample &amp;Menu" id="sampleMenu"> <separator name="sampleGroup"> </separator> </menu> <action class="helloworld.actions.SampleAction" enablesFor="+" icon="icons/sample.gif" id="helloworld.actions.SampleAction" label="&amp;Sample Action" menubarPath="sampleMenu/sampleGroup" toolbarPath="sampleGroup" tooltip="Hello, Eclipse world"> <selection class="org.eclipse.core.resources.IFile"> </selection> </action> </actionSet> </extension> </plugin> (4) the action should now be disabled unless the selection is an IFile. (5) run the plugin and notice that the action is not drawn as a disabled toolbar button. It looks like it is enabled. More information: This can also be seen in the Debug perspective, for the Terminaite/Stop action in the Console view. It always looks enabled, even when you have already stopped whatever application you were running.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginAction.java