Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » multipage editor actions
multipage editor actions [message #323703] Sun, 06 January 2008 20:23 Go to next message
Eclipse UserFriend
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 #323704 is a reply to message #323703] Sun, 06 January 2008 20:58 Go to previous messageGo to next message
Eclipse UserFriend
It isn't possible to do that using the standard Eclipse editors.
However, you can add actions/contributions to the page content area.
See the SQL Editor within the Datatools project or Visual Page Editor
within JBoss Tools.

Snjeza

Jan wrote:
> 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 #323708 is a reply to message #323704] Mon, 07 January 2008 04:14 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

I know, there is not 1standard way of doing that.
But I expect that there is an API by which I can achieve this.
Because eclipse is doing things like initializing actions from action
contributor for editor and also disposing these actions after closing the
editor. I want to what method to call to dispose these action. THe other
things I can do by myself.

BR,
Jan

"Snjezana Peco" <snjeza.peco@gmail.com> wrote in message
news:fls0vf$kkq$1@build.eclipse.org...
> It isn't possible to do that using the standard Eclipse editors.
> However, you can add actions/contributions to the page content area.
> See the SQL Editor within the Datatools project or Visual Page Editor
> within JBoss Tools.
>
> Snjeza
>
> Jan wrote:
>> 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 #323786 is a reply to message #323708] Tue, 08 January 2008 11:00 Go to previous messageGo to next message
Eclipse UserFriend
When you create your MPEP subclass, you also create a subclass of
MultiPageEditorActionBarContributor that is responsible for all actions
for that MPEP ... your MultiPageEditorActionBarContributor must create
and delegate to the individual editor EditorActionBarContributors, if
that's what you want.

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
Re: multipage editor actions [message #323791 is a reply to message #323786] Tue, 08 January 2008 14:29 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Eclipse and User Access Control on Windows Vista
Next Topic:How to access menuContribution from WorkbenchWindow - UPDATED
Goto Forum:
  


Current Time: Sat Jul 19 08:35:29 EDT 2025

Powered by FUDForum. Page generated in 0.03923 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top