Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Excluding custom Composite from tab order
Excluding custom Composite from tab order [message #466599] Wed, 11 January 2006 15:48 Go to next message
Peter Nehrer is currently offline Peter Nehrer
Messages: 240
Registered: July 2009
Senior Member
Hi,

I have a custom Composite (with two Labels in it), which I use within a
form Section. When tabbing through other controls in the section, focus
gets "eaten" by the custom composite -- can't tab out of it again (until
I click some other focusable control).

I understand that I can implement TraverseListener and set e.doit = true
to make this piece work, but what I really want to do is make this
composite behave like a Label in that I want it to be skipped altogether
when traversing. I also know that I can do this by excluding the
composite from its parent's tablist.

However, this would require me to modify code outside of the custom
composite itself -- after the parent is constructed, remove all
instances of this custom composite from its tablist.

Is there anything I can do to the custom composite itself to cause any
parents to skip it when traversing?

Thanks in advance for any suggestions.

--Peter
Re: Excluding custom Composite from tab order [message #466672 is a reply to message #466599] Thu, 12 January 2006 14:56 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika Irvine
Messages: 1272
Registered: July 2009
Senior Member
Do not add any KeyListener to your custom control and it will not be in the
tab order.

"Peter Nehrer" <pnehrer@freeshell.org> wrote in message
news:dq3qub$rok$1@utils.eclipse.org...
> Hi,
>
> I have a custom Composite (with two Labels in it), which I use within a
> form Section. When tabbing through other controls in the section, focus
> gets "eaten" by the custom composite -- can't tab out of it again (until I
> click some other focusable control).
>
> I understand that I can implement TraverseListener and set e.doit = true
> to make this piece work, but what I really want to do is make this
> composite behave like a Label in that I want it to be skipped altogether
> when traversing. I also know that I can do this by excluding the composite
> from its parent's tablist.
>
> However, this would require me to modify code outside of the custom
> composite itself -- after the parent is constructed, remove all instances
> of this custom composite from its tablist.
>
> Is there anything I can do to the custom composite itself to cause any
> parents to skip it when traversing?
>
> Thanks in advance for any suggestions.
>
> --Peter
Re: Excluding custom Composite from tab order [message #466673 is a reply to message #466672] Thu, 12 January 2006 15:10 Go to previous message
Peter Nehrer is currently offline Peter Nehrer
Messages: 240
Registered: July 2009
Senior Member
Veronika,

thanks for the tip -- indeed the composite was being adapted by
FormToolkit in such a way that a key listener was (unnecessarily)
installed on it. It now works as required.

--Peter
Previous Topic:multi-select in trees on linux
Next Topic:How to detect refresh event in Browser
Goto Forum:
  


Current Time: Sat Aug 23 03:34:54 EDT 2014

Powered by FUDForum. Page generated in 0.08351 seconds