multipage editor actions [message #323703] |
Sun, 06 January 2008 20:23  |
Eclipse User |
|
|
|
Hello,
How to have 1 EditorActionBarContributor for each editor page (editor
associated with this page) in the MultiPageEditorPart?
What is needed to change to achieve such kind of functionality?
Best Regards,
Jan
|
|
|
|
|
|
Re: multipage editor actions [message #323791 is a reply to message #323786] |
Tue, 08 January 2008 14:29   |
Eclipse User |
|
|
|
Hello,
Yes,
that is basically what I want, but I want to switch these
EditorActionBarContributors simultaneously to page (editor) switching.
So I want to achieve a behaviour, that for example:
EditorActionBarContributors 1 - for editor 1 - has action set 1
and
EditorActionBarContributors 2 - for editor 2 - has action set 2
Scenario: I want that when is displayed editor 1, then action set 1 is
visible. And also when is selected editor 1, then action set for no other
editor are visible!!!
Same rule is true for every other editor included as a page in MPEP.
So I want to realize switching included editor pages in MPEP together with
switching of the their associater action sets.
Comment: Eclipse has to have somewhere in packages something like dispose()
for EditorActionBarContributor, which disposes all its action, whereever
they are.
1) What I need to implement or call in order to dispose all actions and
everything other from specific EditorActionBarContributor?
2) And maybe easier task what I need to implement or call, is to display all
actions and everything else from EditorActionBarContributor.
How to program tasks 1 and 2?
Maybe good tutorial for describing of its internals will be enough.
Thank you!
Best Regards,
Jan
"Paul Webster" <pwebster@ca.ibm.com> p
|
|
|
Re: multipage editor actions [message #323821 is a reply to message #323791] |
Wed, 09 January 2008 10:12  |
Eclipse User |
|
|
|
Jan Vitasek wrote:
> Hello,
>
> Yes,
>
> that is basically what I want, but I want to switch these
> EditorActionBarContributors simultaneously to page (editor) switching.
> So I want to achieve a behaviour, that for example:
> EditorActionBarContributors 1 - for editor 1 - has action set 1
> and
> EditorActionBarContributors 2 - for editor 2 - has action set 2
>
> Scenario: I want that when is displayed editor 1, then action set 1 is
> visible. And also when is selected editor 1, then action set for no other
> editor are visible!!!
> Same rule is true for every other editor included as a page in MPEP.
>
> So I want to realize switching included editor pages in MPEP together with
> switching of the their associater action sets.
Are you using action sets, or just the editor action bar contributors?
To switch the action sets that are associated with inner editors, you
would have to show and hide them manually when the page changes. Your
MultiPageEditorActionBarContributor could do that in setActivePage(*) or
you can extend pageChange in MPEP (remembering to call
super.pageChange(*) first). Switching action sets can cause some
flicker, so you don't want to do it too often.
Anything that is contributed using each inner editor's
EditorActionBarContributor would be much harder to hide/show, since you
would basically have to delegate to its contributeToMenu(*) method (and
how would you decide which contributions to hide or show).
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
|
|
|
Powered by
FUDForum. Page generated in 0.08237 seconds