|
Re: One ToggleGridAction for several GraphicalViewers [message #192390 is a reply to message #192210] |
Thu, 18 August 2005 16:08 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Retarget actions?
"Martijn van Steenbergen" <mvsteenbergen@eljakim.nl> wrote in message
news:ddsose$885$1@news.eclipse.org...
> Greetings,
>
> I currently have a MultiPageEditor (MPE) which always consists of one
> text (source) editor and zero or more graphical editors. I want to
> create a ToggleGridAction in the MPE's toolbar which 1) is enabled only
> if the active page is a GraphicalEditor and 2) when enabled and clicked,
> toggles the grid in the active GraphicalEditor. Currently, I have my own
> implementation of ToggleGridAction, since the ToggleGridAction in GEF
> doesn't (seem to) allow for switching GraphicalViewers after creation.
> Is there a more elegant solution? Would it be an idea to make a
> setGraphicalViewer() method on ToggleGridAction?
>
> Regards,
>
> Martijn.
|
|
|
Re: One ToggleGridAction for several GraphicalViewers [message #192425 is a reply to message #192390] |
Thu, 18 August 2005 17:51 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The toolbar is already displaying retarget actions since thats necessary
even for single page editors. So all you need to do is change the current
global action handler when the page changes, in the same way that changing
the active (top-level) editor currently does.
One hack that works with MPEs is to trick the editoractionabrcontributor
into thinking that the active editor has changed even though it hasn't, only
the active page has. Or you could just expose and call setActiveEditor
somehow in your EABC.
"Pratik Shah" <none@unknown.com> wrote in message
news:de2bp4$llc$1@news.eclipse.org...
> Retarget actions?
>
> "Martijn van Steenbergen" <mvsteenbergen@eljakim.nl> wrote in message
> news:ddsose$885$1@news.eclipse.org...
>> Greetings,
>>
>> I currently have a MultiPageEditor (MPE) which always consists of one
>> text (source) editor and zero or more graphical editors. I want to
>> create a ToggleGridAction in the MPE's toolbar which 1) is enabled only
>> if the active page is a GraphicalEditor and 2) when enabled and clicked,
>> toggles the grid in the active GraphicalEditor. Currently, I have my own
>> implementation of ToggleGridAction, since the ToggleGridAction in GEF
>> doesn't (seem to) allow for switching GraphicalViewers after creation.
>> Is there a more elegant solution? Would it be an idea to make a
>> setGraphicalViewer() method on ToggleGridAction?
>>
>> Regards,
>>
>> Martijn.
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05365 seconds