Listen for click on editor tab [message #272968] |
Wed, 29 September 2004 15:13 |
Eclipse User |
|
|
|
Originally posted by: paul.wells.modelistic.com
I have an editor which needs to do various things when it gains the focus
(refresh enablement of actions etc). The editor extends EditorPart and
contains a single Canvas.
The problem is that switching between editor instances by clicking on the
tabs at the top of the editor pane doesn't give focus to the Canvas - you
have to click down on the canvas each time to cause a change of focus.
How can I listen for changes in selection of editor (either by clicks on
the tabs or any other means), so that I can automatically pass the focus
to the canvas?
Thanks very much
|
|
|
Re: Listen for click on editor tab [message #273038 is a reply to message #272968] |
Thu, 30 September 2004 12:42 |
Eclipse User |
|
|
|
Originally posted by: douglas.pollock.magma.ca
Paul Wells wrote:
> The problem is that switching between editor instances by clicking on the
> tabs at the top of the editor pane doesn't give focus to the Canvas - you
> have to click down on the canvas each time to cause a change of focus.
The proper way to do this is to override "setFocus()".
> How can I listen for changes in selection of editor (either by clicks on
> the tabs or any other means), so that I can automatically pass the focus
> to the canvas?
While this is not what you want to be doing, you can listen for the part
activation event -- available from WorkbenchPage.
cheers,
d.
|
|
|
Re: Listen for click on editor tab [message #273176 is a reply to message #272968] |
Thu, 30 September 2004 12:01 |
Eclipse User |
|
|
|
Originally posted by: scheglov_ke.nlmk.ru
Paul Wells <paul.wells@modelistic.com> wrote:
May be setFocus() for your WorkbenchPart?
> I have an editor which needs to do various things when it gains the focus
> (refresh enablement of actions etc). The editor extends EditorPart and
> contains a single Canvas.
> The problem is that switching between editor instances by clicking on the
> tabs at the top of the editor pane doesn't give focus to the Canvas - you
> have to click down on the canvas each time to cause a change of focus.
> How can I listen for changes in selection of editor (either by clicks on
> the tabs or any other means), so that I can automatically pass the focus
> to the canvas?
> Thanks very much
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
|
|
|
Powered by
FUDForum. Page generated in 0.01753 seconds