Bug 361935 - [GlobalActions] Registering actions should not be required to use standard org.eclipse.ui commands
Summary: [GlobalActions] Registering actions should not be required to use standard or...
Status: CLOSED DUPLICATE of bug 379257
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 270007
Blocks: 379257
  Show dependency tree
 
Reported: 2011-10-25 10:19 EDT by Paul Webster CLA
Modified: 2013-09-19 05:04 EDT (History)
20 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***