Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [RCP][M7] Menus created in WorkbenchAdvisor's fillActionBars are not displayed anymore
[RCP][M7] Menus created in WorkbenchAdvisor's fillActionBars are not displayed anymore [message #197605] Thu, 19 February 2004 05:32 Go to next message
Eclipse UserFriend
Hi NG,

I am just about porting a rcp app from M6 to M7 and have now noticed, that
the menus which are created by the method fillActionBars are not shown
anymore except the "File"-Menu... I have tried to use
IWorkbenchWindowConfigurer.setShowMenuBar(boolean), but that didn't change
anything...

Does anyone have an idea what's wrong there?

Here the code snippet for the menu creation:

/* (non-javadoc)
* @see
org.eclipse.ui.application.WorkbenchAdvisor#fillActionBars(o rg.eclipse.ui.IW
orkbenchWindow, org.eclipse.ui.application.IActionBarConfigurer, int)
*/
public void fillActionBars(IWorkbenchWindow window,
IActionBarConfigurer configurer, int flags)
{
super.fillActionBars(window, configurer, flags);
if ((flags & FILL_MENU_BAR) != 0)
{
fillMenuBar(window, configurer);
}
}

private void fillMenuBar(IWorkbenchWindow window,
IActionBarConfigurer configurer)
{
IMenuManager menuBar = configurer.getMenuManager();
menuBar.add(createFileMenu(window));
menuBar.add(createSearchMenu(window));
menuBar.add(createHelpMenu(window));
}

private MenuManager createFileMenu(IWorkbenchWindow window)
{
MenuManager menu = new MenuManager("File",
IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(ActionFactory.QUIT.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}

private MenuManager createSearchMenu(IWorkbenchWindow window)
{
MenuManager menu = new MenuManager("Search", SEARCH_MENU);
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator(RADIS_MENU_ADDITIONS));
return menu;
}
private MenuManager createHelpMenu(IWorkbenchWindow window)
{
MenuManager menu = new MenuManager("Help",
IWorkbenchActionConstants.M_HELP);
menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator(RADIS_MENU_ADDITIONS));
menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
return menu;
}
Re: [RCP][M7] Menus created in WorkbenchAdvisor's fillActionBars are not displayed anymore [message #197670 is a reply to message #197605] Thu, 19 February 2004 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Ok, in between I found out that a menu is only displayed if you
programmatically add at least one action to it. Otherwise it is simply
ignored, even if you try to contribute actions to it using your plugin.xml.
Is there any flag or something that I haven't seen yet in any of these
configurers?

"Martin Klinke" <martin-klinke@gmx.de> schrieb im Newsbeitrag
news:c1232s$boo$1@eclipse.org...
> Hi NG,
>
> I am just about porting a rcp app from M6 to M7 and have now noticed, that
> the menus which are created by the method fillActionBars are not shown
> anymore except the "File"-Menu... I have tried to use
> IWorkbenchWindowConfigurer.setShowMenuBar(boolean), but that didn't change
> anything...
>
> Does anyone have an idea what's wrong there?
>
> Here the code snippet for the menu creation:
>
> /* (non-javadoc)
> * @see
>
org.eclipse.ui.application.WorkbenchAdvisor#fillActionBars(o rg.eclipse.ui.IW
> orkbenchWindow, org.eclipse.ui.application.IActionBarConfigurer, int)
> */
> public void fillActionBars(IWorkbenchWindow window,
> IActionBarConfigurer configurer, int flags)
> {
> super.fillActionBars(window, configurer, flags);
> if ((flags & FILL_MENU_BAR) != 0)
> {
> fillMenuBar(window, configurer);
> }
> }
>
> private void fillMenuBar(IWorkbenchWindow window,
> IActionBarConfigurer configurer)
> {
> IMenuManager menuBar = configurer.getMenuManager();
> menuBar.add(createFileMenu(window));
> menuBar.add(createSearchMenu(window));
> menuBar.add(createHelpMenu(window));
> }
>
> private MenuManager createFileMenu(IWorkbenchWindow window)
> {
> MenuManager menu = new MenuManager("File",
> IWorkbenchActionConstants.M_FILE);
> menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
> menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
> menu.add(ActionFactory.QUIT.create(window));
> menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
> return menu;
> }
>
> private MenuManager createSearchMenu(IWorkbenchWindow window)
> {
> MenuManager menu = new MenuManager("Search", SEARCH_MENU);
> menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
> menu.add(new Separator(RADIS_MENU_ADDITIONS));
> return menu;
> }
> private MenuManager createHelpMenu(IWorkbenchWindow window)
> {
> MenuManager menu = new MenuManager("Help",
> IWorkbenchActionConstants.M_HELP);
> menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
> menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
> menu.add(new Separator(RADIS_MENU_ADDITIONS));
> menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
> return menu;
> }
>
>
Re: [RCP][M7] Menus created in WorkbenchAdvisor's fillActionBars are not displayed anymore [message #198194 is a reply to message #197670] Thu, 19 February 2004 22:57 Go to previous message
Eclipse UserFriend
Originally posted by: ed.burnette.REMOVE.THIS.sas.com

No, it's a new bug in M7, not yet fixed. See/cc/vote for:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=52056

--
Ed Burnette, co-author, Eclipse in Action
www.eclipsepowered.org

"Martin Klinke" <martin-klinke@gmx.de> wrote in message
news:c12ere$qe4$1@eclipse.org...
> Ok, in between I found out that a menu is only displayed if you
> programmatically add at least one action to it. Otherwise it is simply
> ignored, even if you try to contribute actions to it using your
plugin.xml.
> Is there any flag or something that I haven't seen yet in any of these
> configurers?
Previous Topic:Getting the Active View
Next Topic:Migrate RCP toolbar code from m5 to m7
Goto Forum:
  


Current Time: Sat May 10 12:06:37 EDT 2025

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

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

Back to the top