| MultiPage Editor : swapping Action ContributorClasses [message #671316] |
Tue, 17 May 2011 09:36  |
Maqsood Ahmed Messages: 41 Registered: September 2010 |
Member |
|
|
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 #671880 is a reply to message #671348] |
Thu, 19 May 2011 04:57   |
Maqsood Ahmed Messages: 41 Registered: September 2010 |
Member |
|
|
Thanks Paul,
But the problem now is hw will i show/hide actions when other editors are opened inside this MPE? The Common Contirbutor would still be there, contirbuting all actions..
I cant access the editor's site while it is being initialized also(is null),
hence unable to disable the actions that i dont need.
There is this problem because, each time the MPE editor that opens up will be having different editor (as a page in this MPE). Can u give some leads to solve this problem.
Mak
[Updated on: Thu, 19 May 2011 05:07] Report message to a moderator
|
|
|
| (no subject) [message #671894 is a reply to message #671348] |
Thu, 19 May 2011 04:57   |
|
Originally posted by: <forums-noreply
Thanks Paul,
But the problem now is hw will i show/hide actions when other editors are opened inside this MPE? The Common Contirbutor would still be there, contirbuting all actions..
I cant access the editor's site while it is being initialized also(is null),
hence unable to disable the actions that i dont need.
Mak
|
|
|
| Re: MultiPage Editor : swapping Action ContributorClasses [message #672002 is a reply to message #671880] |
Thu, 19 May 2011 10:41   |
Paul Webster Messages: 6813 Registered: July 2009 Location: Ottawa |
Senior Member |
|
|
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
| Re: MultiPage Editor : swapping Action ContributorClasses [message #692407 is a reply to message #672002] |
Mon, 04 July 2011 07:52  |
E. Waldin Messages: 5 Registered: April 2010 |
Junior Member |
|
|
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.12681 seconds