Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Help menu
Help menu [message #459833] Thu, 07 December 2006 08:27 Go to next message
Eclipse UserFriend
Hi

How do I define the help menu and about action in plugin.xml ? I am
trying not to use ApplicationActionBarAdvisor.java...

Furthermore, how do I control the order the menus and toolbar actions
are presented in on the screen?

Is it possible?

thanks,
Henrik
Re: Help menu [message #459877 is a reply to message #459833] Fri, 08 December 2006 03:41 Go to previous messageGo to next message
Eclipse UserFriend
Henrik Skovgaard wrote:
> How do I define the help menu and about action in plugin.xml ? I am
> trying not to use ApplicationActionBarAdvisor.java...
>
> Furthermore, how do I control the order the menus and toolbar actions
> are presented in on the screen?
>
> Is it possible?
>

Anyone please? Just a snippet if it's possible...
Re: Help menu [message #459878 is a reply to message #459877] Fri, 08 December 2006 03:48 Go to previous messageGo to next message
Eclipse UserFriend
Henrik,
To add a help menu what you've to do is just add the following piece of
code in the fillMenuBar()method in the ApplicationActionBarAdvisor class.

MenuManager helpMenu = new
MenuManager("&Help",IWorkbenchActionConstants.M_HELP);

regards,
Srivatsan
Re: Help menu [message #459879 is a reply to message #459878] Fri, 08 December 2006 03:55 Go to previous messageGo to next message
Eclipse UserFriend
Srivatsan wrote:
> Henrik,
> To add a help menu what you've to do is just add the following piece of
> code in the fillMenuBar()method in the ApplicationActionBarAdvisor class.
>
> MenuManager helpMenu = new
> MenuManager("&Help",IWorkbenchActionConstants.M_HELP);
>
> regards, Srivatsan
>

Yes thanks I did know that, but then the menu is drawn before those
defined in plugin.xml - how to I control the order they appear in?

/Henrik
Re: Help menu [message #459881 is a reply to message #459879] Fri, 08 December 2006 04:00 Go to previous messageGo to next message
Eclipse UserFriend
Thats simple. You need to add the menu to the menubar in the order in
which you want them to be displayed.
like

menuBar.add(fileMenu);
menuBar.add(helpMenu);
this wud put File menu at the first position and then the Help menu

regards,
Srivatsan
Re: Help menu [message #459882 is a reply to message #459881] Fri, 08 December 2006 04:08 Go to previous messageGo to next message
Eclipse UserFriend
Srivatsan wrote:
> Thats simple. You need to add the menu to the menubar in the order in
> which you want them to be displayed.
> like
>
> menuBar.add(fileMenu);
> menuBar.add(helpMenu);
> this wud put File menu at the first position and then the Help menu
>
> regards,
> Srivatsan

Yes, but I also have menus defined in my plugin.xml, like this:

<menu
id="mviMenu"
label="MVI &amp;Menu">
<separator name="mvi"/>
</menu>
<action
class="dk.reklamedata.mvi.actions.FileOpenAction"
icon="icons/folder_up.png"
id="dk.reklamedata.mvi.actions.FileOpenAction"
label="&amp;Open"
menubarPath="mviMenu/mvi"
toolbarPath="mvi"
tooltip="Open file(s) for import"/>


This menu is drawn after those defined in
ApplicationActionBarAdvisor.java and I can't figure out how to change
the order of them.

Henrik
Re: Help menu [message #459885 is a reply to message #459882] Fri, 08 December 2006 04:30 Go to previous messageGo to next message
Eclipse UserFriend
Menus will be shown in the order in which they were created. And i would
like to know which extension you're using. Is it org.eclipse.ui.menu or is
it the org.eclipse.ui.actionsets? am using the latter wherein i'll attach
actions to bothe menubars n toolbars and this extension provides me the
facility to not only declare actions but define menus n associate the
actions with those menus.
Re: Help menu [message #459902 is a reply to message #459882] Fri, 08 December 2006 09:35 Go to previous message
Eclipse UserFriend
Henrik Skovgaard wrote:
>
> Yes, but I also have menus defined in my plugin.xml, like this:
>
> <menu
> id="mviMenu"
> label="MVI &amp;Menu">
> <separator name="mvi"/>
> </menu>
> <action
> class="dk.reklamedata.mvi.actions.FileOpenAction"
> icon="icons/folder_up.png"
> id="dk.reklamedata.mvi.actions.FileOpenAction"
> label="&amp;Open"
> menubarPath="mviMenu/mvi"
> toolbarPath="mvi"
> tooltip="Open file(s) for import"/>
>

You need to place the <menu/> element just like you place the <action/>
element. Add an additions group marker in your program, and then place
<menu/> at the group marker.

Check out WorkbenchActionBuilder#fillMenuBar(*)

Later,
PW
Previous Topic:Menu Window-Navigation show view menu
Next Topic:How to pass command line argument to an RCP application
Goto Forum:
  


Current Time: Sat Mar 15 00:18:55 EDT 2025

Powered by FUDForum. Page generated in 0.03956 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top