Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Mixing Platform Command and Action Set frameworks
Mixing Platform Command and Action Set frameworks [message #333571] Wed, 17 December 2008 14:31 Go to next message
Pete Ellis is currently offline Pete EllisFriend
Messages: 85
Registered: July 2009
Member
In short: is it possible for a Menu Contribution to specify a menu
identifier from an ActionSet?

We are looking at whether or not it is possible to feather in the command
framework approach (which we like quite a bit!), or if we will need to just
perform a complete replacement of all of our existing ActionSet based
platform contributions (a somewhat lengthy effort that we'd like to defer,
if possible).

Thanks for any feedback/pointers on this,

-Pete
Re: Mixing Platform Command and Action Set frameworks [message #333573 is a reply to message #333571] Wed, 17 December 2008 14:48 Go to previous messageGo to next message
Adam Lucarz is currently offline Adam LucarzFriend
Messages: 518
Registered: July 2009
Senior Member
Pete Ellis schrieb:
> In short: is it possible for a Menu Contribution to specify a menu
> identifier from an ActionSet?
>
> We are looking at whether or not it is possible to feather in the command
> framework approach (which we like quite a bit!), or if we will need to just
> perform a complete replacement of all of our existing ActionSet based
> platform contributions (a somewhat lengthy effort that we'd like to defer,
> if possible).
>
> Thanks for any feedback/pointers on this,
>
> -Pete
>
>

My experience is that you can mix them. But you cannot contribute
declarative made menues by the old actions. That is the only pitfall I
know about.

Adam
Re: Mixing Platform Command and Action Set frameworks [message #333576 is a reply to message #333571] Wed, 17 December 2008 19:12 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

As mentioned, they can co-exist. For something like the main menu bar,
first the programmatic items are added (like WorkbenchActionBuilder)
then the org.eclipse.ui.menus contributions. Then finally, any
org.eclipse.ui.actionSets are processed. Action sets cannot see menus
defined in each other, but then can see menus defined in
org.eclipse.ui.menus.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Mixing Platform Command and Action Set frameworks [message #333614 is a reply to message #333576] Thu, 18 December 2008 14:09 Go to previous messageGo to next message
Pete Ellis is currently offline Pete EllisFriend
Messages: 85
Registered: July 2009
Member
Adam and Paul - thank you for the feedback.

> As mentioned, they can co-exist. For something like the main menu bar,
> first the programmatic items are added (like WorkbenchActionBuilder) then
> the org.eclipse.ui.menus contributions. Then finally, any
> org.eclipse.ui.actionSets are processed. Action sets cannot see menus
> defined in each other, but then can see menus defined in
> org.eclipse.ui.menus.
>

Based on this order, it may make sense why I have not been successful thus
far... I am trying to add a org.eclipse.ui.menus contribution to a menu
defined in an existing action set. However, if the action set is not
evaluated until after ui.menus, than ui.menus will come up empty when
looking up an action set menu identifier. Perhaps I'm missing something
here. When I attempt something simple such as:

<extension point="org.eclipse.ui.actionsSets">
<actionSet
id="actionSet1"
visible="true"
<menu
id="menu1" label="TestMenu">
<groupMarker name="group1"/> </menu>
... actions ...
</actionSet> </extension>

<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:menu1?after=group1">
<command
commandId="aCommandId"> </command>
</menuContribution> </extension>

the menu contribution for "aCommandId" does not appear in the menu specified
in action set "actionSet1".

Am I omitting a step here? Should I expect this to work/not work?

Thanks, -Pete
Re: Mixing Platform Command and Action Set frameworks [message #333620 is a reply to message #333614] Thu, 18 December 2008 15:32 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Pete Ellis wrote:
> Adam and Paul - thank you for the feedback.
>
>> As mentioned, they can co-exist. For something like the main menu bar,
>> first the programmatic items are added (like WorkbenchActionBuilder) then
>> the org.eclipse.ui.menus contributions. Then finally, any
>> org.eclipse.ui.actionSets are processed. Action sets cannot see menus
>> defined in each other, but then can see menus defined in
>> org.eclipse.ui.menus.
>>
>
> Based on this order, it may make sense why I have not been successful thus
> far... I am trying to add a org.eclipse.ui.menus contribution to a menu
> defined in an existing action set.

Right, you cannot do this. actionSet menus are "local" to that action
set, nothing else can see them.

You can add your menu definition to your menu contribution as well, then
it would be visible to action sets and menu contributions.

And example is:

<menuContribution
<!-- this places the menu, you can fool with the location-->
locationURI="menu:org.eclipse.ui.main.menu?after=additions" >
<menu id="my.menu1" label="TestMenu">
<separator visible="false" name="group1"/>
</menu>
</menuContribution>

You can even roll up your command menu contribution and simply place it
in the structure. You also need to make sure that your IDs match
(my.menu1) in the menu contributions and action sets.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Mixing Platform Command and Action Set frameworks [message #333628 is a reply to message #333620] Thu, 18 December 2008 17:13 Go to previous message
Pete Ellis is currently offline Pete EllisFriend
Messages: 85
Registered: July 2009
Member
Great! This aproach works well, and will allow us to gradually add support
for the command framework without disrupting our entire existing ActionSet
implementation.

Many thanks, Paul! -Pete
Previous Topic:Inconsistent behaviour in TextEditor
Next Topic:p2: problem with permissions.properties on linux
Goto Forum:
  


Current Time: Sat Apr 20 04:05:24 GMT 2024

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

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

Back to the top