Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Standardactions in ActionSets
Standardactions in ActionSets [message #453121] Sat, 22 July 2006 11:01 Go to next message
Holger is currently offline HolgerFriend
Messages: 6
Registered: July 2009
Junior Member
My Intention is to declare ALL my actions within plugin.xml (ActionSets)
.. .just like this Example:

<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="test.area.actionSet.Tree"
id="test.area.actionSet.Tree"
visible="true"
>
<menu
label="&amp;Tree"
id="test.area.menu.Menu1"
>
<separator name = "slot1"/>
>
</menu>
<action
class="test.area.actionset.navi.TreeCollapse"
id="test.area.action.Treecollapse"
label="Tree collapse"
menubarPath="test.area.menu.Menu1/slot1"
toolbarPath="test.area.menu.Menu1/slot1"/>
<action
class="test.area.actionset.navi.TreeExpand"
id="test.area.action.treeExpand"
label="Tree expand"
menubarPath="test.area.menu.Menu1/slot1"
toolbarPath="test.area.menu.Menu1/slot1"/>
</actionSet>
</extension>


MY CONCRETE QUESTION:
---------------------

Does anybody know, how to add Standard actions (like QUIT, ABOUT,
PREFERENCES) to MenuBar via plugin.xml / ActionSets

(Of course I know about an alternative Solution using ActionBarAdvisor and
ActionFactory. But this is still NOT my intention.)


Thanks
Holger
Re: Standardactions in ActionSets [message #453139 is a reply to message #453121] Sun, 23 July 2006 14:37 Go to previous messageGo to next message
Mario Winterer is currently offline Mario WintererFriend
Messages: 136
Registered: July 2009
Senior Member
Holger schrieb:
> My Intention is to declare ALL my actions within plugin.xml (ActionSets)
> . .just like this Example:
>
> <extension
> point="org.eclipse.ui.actionSets">
> <actionSet
> label="test.area.actionSet.Tree"
> id="test.area.actionSet.Tree"
> visible="true"
> >
> <menu
> label="&amp;Tree"
> id="test.area.menu.Menu1"
> >
> <separator name = "slot1"/>
> >
> </menu>
> <action
> class="test.area.actionset.navi.TreeCollapse"
> id="test.area.action.Treecollapse"
> label="Tree collapse"
> menubarPath="test.area.menu.Menu1/slot1"
> toolbarPath="test.area.menu.Menu1/slot1"/>
> <action
> class="test.area.actionset.navi.TreeExpand"
> id="test.area.action.treeExpand"
> label="Tree expand"
> menubarPath="test.area.menu.Menu1/slot1"
> toolbarPath="test.area.menu.Menu1/slot1"/>
> </actionSet>
> </extension>
>
>
> MY CONCRETE QUESTION:
> ---------------------
>
> Does anybody know, how to add Standard actions (like QUIT, ABOUT,
> PREFERENCES) to MenuBar via plugin.xml / ActionSets
>
> (Of course I know about an alternative Solution using ActionBarAdvisor and
> ActionFactory. But this is still NOT my intention.)
>
>
> Thanks
> Holger
>

Hi Holger!

All standard actions like QUIT, ABOUT etc. are non-public classes that can't be instantiated outside their defining plugin (or at least they shouldn't ;-) ). The only legal way to instantiate those standard actions is via ActionFactory.
Apart from that, those actions do not implement IWorkbenchWindowActionDelegate, which is necessary for the actionSet extension point.

So if you really want to add those actions via plugin.xml, I think you have to write delegates of type IWorkbenchWindowActionDelegate - one for each standard action. In the "run" method of your delegate, instantiate the corresponding standard action via ActionFactory and call its "run" method.

So lot of work to do...


Best regards,
Tex
Re: Standardactions in ActionSets [message #453176 is a reply to message #453139] Mon, 24 July 2006 13:17 Go to previous message
Holger is currently offline HolgerFriend
Messages: 6
Registered: July 2009
Junior Member
Hi Mario,

thanks ... I did it this way and it works. Makes sense due to the fact,
that there are not so much standard actions required in our project.

cu
Holger
Previous Topic:ComposedAdapterFactory
Next Topic:Howt o save the state of a perspective?
Goto Forum:
  


Current Time: Thu Oct 03 23:41:13 GMT 2024

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

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

Back to the top