Getting the main Menu bar in Eclipse 3.3 [message #332524] |
Sun, 26 October 2008 08:52  |
Eclipse User |
|
|
|
I need to get the main menu bar from inside a custom view (not an
editor) to initialize an ActionBarContributor class. I know that inside
an editor I can use the ActionBarContributor in the plugin.xml and the
workbench will initialize it. I can also use the
getSite().getAcionBar() to get top menu and use that to initialize the
ActionBarContributor.
How can I get the same value and initialize a contributor in a View?
(the main reason it to get to the REDO/UNDO, File Save and etc).
Thanks
Yigal.
|
|
|
|
|
Re: Getting the main Menu bar in Eclipse 3.3 [message #332543 is a reply to message #332541] |
Mon, 27 October 2008 18:39   |
Eclipse User |
|
|
|
Yigal,
In the EMF newsgroup, there was some advice about how to do this in a
view; unfortunately I have no experience with views, other than views
like the outline which is a satellite to the editor.
Yigal Spinner wrote:
> Paul,
> I want to use the basic "Edit" menu and plug in the REDO, UNDO, Cut
> and etc actions.
> In the EMF world they have EditingDomainActionBarContributor that
> switch this values based on the editor. I want to duplicate the
> functionality but for views.
> In the EditingDomainActionBarContributor it gets initialized with the
> top menu bar from the editor. Then each time the editor switches the
> class uses the EditingDomian class to get the command stack and use it
> in the menu.
> I want to use the same command stack from EditingDoain, but in a view.
> To implement that I need to top menu ActionBar reference.
> I could not find any examples that show how to assign new action to
> the Edit menu from a view. It is always using a popup menu or the
> view action bar.
>
> Yigal
>
> Paul Webster wrote:
>> What are you trying to do, exactly? The view actionbars don't have
>> access to the main menu, at least no commonly.
>>
>> Are you trying to add some view actions to the main menu? You have a
>> couple of options, either using actionSets with an
>> actionSetPartAssociation or using org.eclipse.ui.menus and placing
>> commands that specifically deal with your view.
>>
>> There is no API available to get the main menu or main coolbar.
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05080 seconds