Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding "standard" menu items to Eclipse RCP application?
Adding "standard" menu items to Eclipse RCP application? [message #1113603] Sat, 21 September 2013 07:25 Go to next message
Alan DW is currently offline Alan DW
Messages: 101
Registered: March 2012
Senior Member
Hello,

I'm currently working on my first real (3.x) RCP application (only worked on plug-ins before) and I struggle with a problem in my main menu bar. The menu bar in my application is currently empty, but I want almost all of the more general menu commands which are offered by Eclipse itself, for example "File -> New", "File -> Save", "Edit -> Copy", "Window -> Open Perspective" and so on.

What is the recommended way of adding these commands to an RCP application? Do I really have to go to my plugin.xml and add them all manually one-by-one?


Thanks,


Alan
Re: Adding "standard" menu items to Eclipse RCP application? [message #1113633 is a reply to message #1113603] Sat, 21 September 2013 08:33 Go to previous message
Alan DW is currently offline Alan DW
Messages: 101
Registered: March 2012
Senior Member
Hi,

I just figured it out. Basically all one has to do to get all default IDE actions is to:

- Create a custom WorkbenchAdvisor
- Create a custom WorkbenchWindowAdvisor and return it in WorkbenchAdvisor#createWorkbenchWindowAdvisor
- In the custom WorkbenchWindowAdvisor, use this:

	@Override
	public ActionBarAdvisor createActionBarAdvisor(final IActionBarConfigurer configurer) {
		return new WorkbenchActionBuilder(configurer);
	}


I know, the WorkbenchActionBuilder is actually an internal class with discouraged access, but it works and does *exactly* what I want.

If someone knows of a better way to accomplish this without referring to an internal class, plase let me know.


Alan
Previous Topic:ISO 9241?
Next Topic:contributing to another plug-in's preference page
Goto Forum:
  


Current Time: Wed Apr 16 00:54:09 EDT 2014

Powered by FUDForum. Page generated in 0.02645 seconds