Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361935

Summary: [GlobalActions] Registering actions should not be required to use standard org.eclipse.ui commands
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P4 CC: adietish, alain.leguennec, alexignaciodasilva, Andreas.Muelder, apupier, carlo.salinari, daniel.rolka, daniel_megert, emoffatt, mariot.chauvin, mathieu.velten, prakash, prince_from_north, ralf, remy.suen, sieverssj, spacehorst, steffen.felbinger, strider80, techteam
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 270007    
Bug Blocks: 379257    

Description Paul Webster CLA 2011-10-25 10:19:21 EDT
The changes that were released so far must be merged into 4.2

+++ This bug was initially created as a clone of Bug #270007 +++

Build ID: M20090211-1700

Steps To Reproduce:
Create an empty Eclipse RCP application and contribute some standard commands from org.eclipse.ui to the menu:

   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:org.eclipse.ui.main.menu">
         <menu
               id="de.rcpbuch.someapp.file"
               label="File">
            <command
                  commandId="org.eclipse.ui.file.save"
                  style="push">
            </command>
         </menu>
         <menu
               id="help"
               label="Hilfe">
            <command
                  commandId="org.eclipse.ui.help.aboutAction"
                  style="push">
            </command>
            <command
                  commandId="org.eclipse.ui.help.dynamicHelp"
                  style="push">
            </command>
         </menu>
      </menuContribution>
   </extension>

These commands will not be enabled till you register the related actions in the ActionBarAdvisor:

public class ApplicationActionBarAdvisor extends ActionBarAdvisor {

	protected void makeActions(IWorkbenchWindow window) {
		register(ActionFactory.SAVE.create(window));
		register(ActionFactory.HELP_CONTENTS.create(window));
		register(ActionFactory.DYNAMIC_HELP.create(window));
	}
}


More information:
Ideally this should just work so you can get rid of the ActionBarAdvisor.
If this is not possible you should get at least a warning about this when you use these commands.
If this is not possible this should at least be documented properly.

I did a search for actionbaradvisor AND command AND register in the documentation and bug database before filing this bug.
Comment 1 Eric Moffatt CLA 2011-12-09 13:10:04 EST
Aggregate move to M5. Retarget to a different milestone if you wish...
Comment 2 Eric Moffatt CLA 2012-04-17 13:48:58 EDT
Paul, this looks like a good candidate to defer...
Comment 3 Daniel Rolka CLA 2013-09-19 05:04:09 EDT

*** This bug has been marked as a duplicate of bug 379257 ***