What I need is the focus cycling between "MyCustomPanel" instances when the user presses tab - e.g. panels must get the focus events and buttons should not get the focus. Currently (I'm on GTK) focus is aquired by buttons.

I think the following snippet demonstrates what you need. It has a
Composite (with child Button) that can receive focus, and handles its
own traversals. The only case the snippet does not address is if focus
is in the control following the Composite and a user Ctrl+Tab's
backwards into the Composite, which will leave focus in its child
button. To handle this I think the Composite has to add FocusIn
listeners to all of its children, and take the focus for itself when
this happens.

On 10/19/2012 8:51 PM, Eugene Ostroukhov wrote:
> I have following widget layout:
> Composite
> |MyCustomPanel
> ||Label
> ||Button
> |MyCustomPanel
> ||Label
> ||Button
>
> "MyCustomPanel" is a custom class subclassing Composite.
>
> What I need is the focus cycling between "MyCustomPanel" instances when
> the user presses tab - e.g. panels must get the focus events and buttons
> should not get the focus. Currently (I'm on GTK) focus is aquired by
> buttons.
>
> Is there a way to do it in SWT?