|
Re: Standardactions in ActionSets [message #453139 is a reply to message #453121] |
Sun, 23 July 2006 14:37 |
Mario Winterer 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="&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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04248 seconds