MultiPage Editor : swapping Action ContributorClasses [message #671316] |
Tue, 17 May 2011 09:36  |
Eclipse User |
|
|
|
Hi all,
I have a MPE having a its Action Contributor Class. I then have added 'my editor' to this MPE, The MPE is not considering the added editor's Contributor Class(extends MultipageEditorActionBarContributor)..
My Question is
1) How do i swap Action ContributorClasses(Show/Hide/Disable Actions in the ActionBar) as and when my editor in this MPE is opened.
2) How to add Actions contributed my Editor's MPEABC to the existing action Bar
Best Regards,
Mak
|
|
|
|
|
|
Re: MultiPage Editor : swapping Action ContributorClasses [message #672002 is a reply to message #671880] |
Thu, 19 May 2011 10:41   |
Eclipse User |
|
|
|
Are you asking about actions contributed through each editors EditorActionBarContributors (possibly 2 per real editor)? Or are you asking about editors that add IActions to their IActionBars in their createPartControl(Composite) method?
In the first case, those contributions literally don't exist. There's no "I'll just point my MPEP at the original editor" API, because there are 2 many assumptions to host them correctly within an editor. If you want this case, the MPEP editor/EditorActionBarContributor has to re-implement everything it wants to swap in and out for each type of editor in its pages, and manage the whole thing itself.
In the second case, it looks like org.eclipse.ui.part.MultiPageEditorSite simply delegates to MPEP actionBars, which would mean the multiple editors in the MPEP would simple contribute all of their actions (they'd all be available while the MPEP was the active editor, regardless of what page it was on). In theory the MultiPageEditorSite is extendable, but I'm unless providing SubActionBars per site worked, I'm not sure what it would do.
PW
|
|
|
Re: MultiPage Editor : swapping Action ContributorClasses [message #692407 is a reply to message #672002] |
Mon, 04 July 2011 07:52  |
Eclipse User |
|
|
|
Try taking a look at the eclipse corner article "Integrating EMF and GMF Generated Editors", in particular the section "Completing Menus and Toolbars". There is some nifty code for binding in the action bar contributors of the different editors. Look at TopicmapMultipageActionBarContributor and SubActionBarsExt. It's quite general. Just ignore all the stuff in the beginning about modifying the EMF editor. Hope this helps.
-Earl
|
|
|
Powered by
FUDForum. Page generated in 0.04323 seconds