Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Listen for click on editor tab
Listen for click on editor tab [message #272968] Wed, 29 September 2004 15:13 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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)
Previous Topic:awt problem in eclipse
Next Topic:Python Plugin
Goto Forum:
  


Current Time: Fri Apr 19 14:32:21 GMT 2024

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

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

Back to the top