IWorkbenchPart.setFocus() not called on Mac OS X 10.66 [message #671685] |
Wed, 18 May 2011 16:56 |
Eclipse User |
|
|
|
Originally posted by: Esteban DUGUEPEROUX
Hi,
I have a Eclipse based application with a editor, this editor overrides
the IWorkbenchPart.setFocus() operation to do some stuffs. On
Linux/Windows, having two editors (EMF editor for example) on the same
file, the two editors are side by side (using EditorSashContainer),
starting with the focus on the first editor, then changing the focus on
the second editor (by clicking on the tab of the editor) calls
IWorkbenchPart.setFocus() on the second editor (OK), changing the focus
by clicking in the middle of the second editor calls
IWorkbenchPart.setFocus() (OK). But not on Mac OS X (10.66) for the
second case, clicking in the middle of the second editor doesn't calls
IWorkbenchPart.setFocus() (KO).
This issue was reproduced on helios.
By debugging, we can see a difference in PartPane.setFocus(),
SwtUtil.isFocusAncestor() returns true on Mac while returns false on
Linux/Windows.
This seems a swt mac fragment bug, but can't find where.
Best Regards.
|
|
|
|
Re: IWorkbenchPart.setFocus() not called on Mac OS X 10.66 [message #671865 is a reply to message #671690] |
Thu, 19 May 2011 08:16 |
Eclipse User |
|
|
|
Originally posted by: Esteban DUGUEPEROUX
Hi,
Thanks for your fast reply, indeed I can use
IPartListener2.partActivated() even IPartListener.partActivated() to do
my stuffs, but about the IWorkbenchPart.setFocus() there is yet a
behaviour difference between Linux/Windows & Mac for EcoreEditor for
example, where the setFocus() is not called on Mac when clicking in the
middle while it is called on Linux/Windows.
Best Regards.
On 18/05/2011 19:19, Paul Webster wrote:
> Just FYI. The contract for org.eclipse.ui.IWorkbenchPart.setFocus() is
> to allow the part to assign focus to one of its child controls. That's it.
>
> And that's because if the workbench activates a part (programmatically,
> or because the part's tab was selected) we'll call this method. But if
> the user clicks in a control in the part, we usually don't call this
> method (the control already has focus, it's redundant).
>
> If you need to perform actions other than myControl.setFocus() on part
> activation, you should use an IPartListener2.
>
> PW
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05479 seconds