Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Menus not loading
Menus not loading [message #467657] Wed, 09 May 2007 15:30 Go to next message
Eclipse UserFriend
Hi,
I have an RCP app with several plug-ins that contribute menu items.
This is done exclusively through plugin.xml Actionset extensions and the
plugins know nothing of each other.

The plug-in with the application class sets up the menus and others
contribute items to these.

The problem is that the items are loading before the menus and are
therefore failing. The menus have not yet been defined.

Does anyone know what determines the order of loading?
How can I force the actionset from the main application plug-in to load
first?

Thanks
Roger
Re: Menus not loading [message #467741 is a reply to message #467657] Thu, 10 May 2007 09:44 Go to previous messageGo to next message
Eclipse UserFriend
Roger Nye wrote:
> Hi,
> I have an RCP app with several plug-ins that contribute menu items.
> This is done exclusively through plugin.xml Actionset extensions and the
> plugins know nothing of each other.
>
> The plug-in with the application class sets up the menus and others
> contribute items to these.
>
> The problem is that the items are loading before the menus and are
> therefore failing. The menus have not yet been defined.

The ApplicationActionBarAdvisor is called before all XML contributions.


The XML contributions are then added in a semi-defined order (most of
the time, they're sorted by plugin id, but not always).

What are you seeing? Are you saying that your action bar advisor fill
methods are being called after XML is processed?

Later,
PW
Re: Menus not loading [message #467787 is a reply to message #467741] Thu, 10 May 2007 14:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi Paul,
The menus are created in XML so although the ApplicationActionBarAdvisor
is getting called first it does nothing.

If the actionset were being sorted by plug-in ID this would be good (as it
happens), but they are not.

I tried stepping through code and it looks like the order is determined by
that produced from HashSet field "visibleItems" in
org.eclipse.ui.internal.ActionSetManager.

However, as far as I am aware, there is no guarantee about the order of
items produced by a HashSet. So it looks to me as if it is impossible to
control the order of the XML action set loading.

In the meantime, I have been migrating the menu creation to the
ApplicationActionBarAdvisor which I hadn't wanted to do as it splits the
internationalisation, but this is a minor inconvenience.

Best regards
Roger
Re: Menus not loading [message #467798 is a reply to message #467787] Thu, 10 May 2007 14:53 Go to previous message
Eclipse UserFriend
Roger Nye wrote:
> Hi Paul,
> The menus are created in XML so although the ApplicationActionBarAdvisor
> is getting called first it does nothing.

Oh, you don't have anything in your action bar advisor?

> If the actionset were being sorted by plug-in ID this would be good (as
> it happens), but they are not.

If they are all in XML, then each set of menus and actions must be self
contained and cannot depend on anything defined in another actionSet.
It's a limitation of actionSets and is defined in the extension point
description

If you have 2 actionSets that want to contribute to a main menu item for
example, you would need to define the <menu/> element hierarchy in both
actionSets

PW
Previous Topic:Eclipse RCP 3.3M6 and Java Web Start
Next Topic:Binding commands to IActionDelegate in context menus
Goto Forum:
  


Current Time: Wed May 14 11:55:28 EDT 2025

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

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

Back to the top