Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » ActionSet Menu Paths
ActionSet Menu Paths [message #397360] Mon, 29 November 2004 11:19 Go to next message
Eclipse UserFriend
Hi All,

I'm having a very frustrating time configuring menu paths for action
sets within plugin.xml. (in contrast, toolbar paths seem to work fine).

I cannot contribute actions for a dependent plugin to an action set
defined in its 'parent' plugin. The plugin.xml's (with irrelevent
attributes stripped off) are respectively:

'Parent' plugin:

<plugin
id="com.eu.incremental.epic.shiprepair.project"
... >

<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Project Actions"
visible="true"
id="com.eu.incremental.epic.shiprepair.project.actionSet">
<menu
label="Project"
id="projectMenu"
path="additions">
<separator
name="1">
</separator>
</menu>
<action>
menubarPath="projectMenu/1"
toolbarPath="projectGroup"
... other attributes stripped off
</action>



'Dependent' Plugin:

<plugin
id="com.eu.incremental.epic.shiprepair.mgmt"
... >

<requires>
<import plugin="com.eu.incremental.epic.shiprepair.project"/>
...
</requires>

<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Project LifeCycle Actions"
visible="true"
id="com.eu.incremental.epic.shiprepair.mgmt.actionSet">
<action
menubarPath="additions/projectMenu/1"
toolbarPath="com.eu.incremental.epic.shiprepair.project
..actionSet/projectGroup"
... other attributes stripped off
</action>

The parent plugin is fine, the dependent plugin's action appears happily
on the parent toolbar, but I cannot get it to appear on the menu.
Something is wrong with my menybarPath and I cannot see what it is.
From the extension point Help file it states

menubarPath - a slash-delimited path ('/') used to specify the location
of this action in the menu bar. Each token in the path, except the last
one, must represent a valid identifier of an existing menu in the
hierarchy. The last token represents the named group into which this
action will be added. If the path is omitted, this action will not
appear in the menu bar.

Hence I thought it would be either:
- additions/projectMenu/1
or
- additions/com.eu.incremental.epic.shiprepair.project.project Menu/1
but neither seems to work. I have tried just about every other
combination I can think of but have got nowhere.

I run my app with a cleared workspace every time.

Can someone see my blind spot?

Thanks in advance,

Mike E.



--
Mike Evans
Incremental Ltd.
www.incremental.eu.com
Re: ActionSet Menu Paths [message #397370 is a reply to message #397360] Tue, 30 November 2004 02:37 Go to previous messageGo to next message
Eclipse UserFriend
it should be
<action
menubarPath="projectMenu/1"
...
</action>
will add your dependent action to right below the seperator "1" (above your
parent action(s))

To add it below your parent action(s), your parent need to define either a
seperator/groupMarker (e.g. "additions") to mark where other plugins can
insert their own action. It becomes
<action
menubarPath="projectMenu/1/additions"
...
</action>


From your parent plugin.xml, a plugin declaring
<action
menubarPath="additions"
...
</action>
will add to top menu right before "projectMenu"

Hope I get it right =)

Regards,
CK Ng
Re: ActionSet Menu Paths [message #397463 is a reply to message #397370] Tue, 30 November 2004 03:52 Go to previous message
Eclipse UserFriend
Thank you.
This helped me identify the problem.
I had previously tried your (correct) solution without success so I now
knew that something else was the problem.
It turned out to be the 'visible' attribute of the action set.
The parent plugin's action set is actually defined as visible='false'
and then set visible at runtime depending on the user's permissions. (I
simplified in my previous post as had considered it irrelevant!). Hence
the action set is invisible at the time the dependent plugin's xml is
read hence the dependent actions do not see the parent action set.
I now have both action sets made visible at runtime and everything is fine.
Thanks again - without your input I would not have realised this.

Mike E.

CK Ng wrote:
> it should be
> <action
> menubarPath="projectMenu/1"
> ...
> </action>
> will add your dependent action to right below the seperator "1" (above your
> parent action(s))
>
> To add it below your parent action(s), your parent need to define either a
> seperator/groupMarker (e.g. "additions") to mark where other plugins can
> insert their own action. It becomes
> <action
> menubarPath="projectMenu/1/additions"
> ...
> </action>
>
>
> From your parent plugin.xml, a plugin declaring
> <action
> menubarPath="additions"
> ...
> </action>
> will add to top menu right before "projectMenu"
>
> Hope I get it right =)
>
> Regards,
> CK Ng
>
>

--
Mike Evans
Incremental Ltd.
www.incremental.eu.com
Previous Topic:Does help system must add org.eclipse.tomcat?
Next Topic:Menu
Goto Forum:
  


Current Time: Sun Sep 14 19:43:54 EDT 2025

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

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

Back to the top