Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » FormText Tabbing.
FormText Tabbing. [message #335104] Mon, 23 March 2009 13:10 Go to next message
Irum Godil is currently offline Irum GodilFriend
Messages: 35
Registered: July 2009
Member
Hi,

I am using a FormText control to display some labels, however, I want to
prevent tab to enter into this control at all. Today it enters but does
not show the cursor. I want the tab key to completely skip the FormText
Control.

Since I do not have direct access to the FormText code, I tried to add a
listener for Tab key and reflectively invoke the "advance" method on it as
follows, but this does not work either.

label1.addListener(SWT.Traverse, new Listener() {
public void handleEvent(Event e) {
if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
try {
Object obj = //reflective call to Advance
e.doit = ((Boolean)obj).booleanValue();
}
...

});

I will really appreciate if someone can tell me what to do here and how to
resolve this issue.

Thanks,
Irum.
Re: FormText Tabbing. [message #335158 is a reply to message #335104] Tue, 24 March 2009 13:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 3/23/2009 9:10 AM, Irum Godil wrote:
> Hi,
>
> I am using a FormText control to display some labels, however, I want to
> prevent tab to enter into this control at all. Today it enters but does
> not show the cursor. I want the tab key to completely skip the FormText
> Control.
> Since I do not have direct access to the FormText code, I tried to add a
> listener for Tab key and reflectively invoke the "advance" method on it
> as follows, but this does not work either.
>
> label1.addListener(SWT.Traverse, new Listener() {
> public void handleEvent(Event e) {
> if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
> try {
> Object obj = //reflective call to Advance
> e.doit = ((Boolean)obj).booleanValue();
> }
> ...
>
> });
>
> I will really appreciate if someone can tell me what to do here and how
> to resolve this issue.


Have a look at TraverseListener and TraverseEvent.

Hope this helps,
Eric
Re: FormText Tabbing. [message #335194 is a reply to message #335158] Wed, 25 March 2009 14:44 Go to previous messageGo to next message
Irum Godil is currently offline Irum GodilFriend
Messages: 35
Registered: July 2009
Member
Hi,

I did look at the classes mentioned by you, but it does not solve my
problem exactly. Basically, I have 2 controls in my form, one is a
FormText, and the other can be any SWT/more complex widget.

I actually have a series of them, so something like:

Label1 Text
Label2 Combo
Label3 Something more complex

Now, what I want is that the tab always comes in the 2nd field, but skips
all the labels.

If I set e.doit = false, for the labels, then the tab does not continue
past the first label. If I set it to true, I see the same behaviour as
today.

How can I just skip tab from the FormText, but ensure it goes to the next
control on the page?

Thanks for your responses.
Irum.
Re: FormText Tabbing. [message #335231 is a reply to message #335194] Thu, 26 March 2009 16:59 Go to previous messageGo to next message
Irum Godil is currently offline Irum GodilFriend
Messages: 35
Registered: July 2009
Member
Irum Godil wrote:

> Hi,

> I did look at the classes mentioned by you, but it does not solve my
> problem exactly. Basically, I have 2 controls in my form, one is a
> FormText, and the other can be any SWT/more complex widget.

> I actually have a series of them, so something like:

> Label1 Text
> Label2 Combo
> Label3 Something more complex

> Now, what I want is that the tab always comes in the 2nd field, but skips
> all the labels.

> If I set e.doit = false, for the labels, then the tab does not continue
> past the first label. If I set it to true, I see the same behaviour as
> today.

> How can I just skip tab from the FormText, but ensure it goes to the next
> control on the page?

> Thanks for your responses.
> Irum.
Hi,

I was hoping if someone can please help me on this one, or direct me to
some resources where I can find the solution.

Really appreciate your help.

Thanks,
Irum.
Re: FormText Tabbing. [message #335233 is a reply to message #335194] Thu, 26 March 2009 18:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 3/25/2009 10:44 AM, Irum Godil wrote:
> Hi,
> I did look at the classes mentioned by you, but it does not solve my
> problem exactly. Basically, I have 2 controls in my form, one is a
> FormText, and the other can be any SWT/more complex widget.
> I actually have a series of them, so something like:
>
> Label1 Text
> Label2 Combo
> Label3 Something more complex
>
> Now, what I want is that the tab always comes in the 2nd field, but
> skips all the labels.
> If I set e.doit = false, for the labels, then the tab does not continue
> past the first label. If I set it to true, I see the same behaviour as
> today.
> How can I just skip tab from the FormText, but ensure it goes to the
> next control on the page?

I don't understand; Label widgets don't take focus (on Windows, at
least). So the default focus traversal for a Composite should
automatically find the "next" focusable control.

Eric
Re: FormText Tabbing. [message #335235 is a reply to message #335233] Thu, 26 March 2009 18:11 Go to previous messageGo to next message
Irum Godil is currently offline Irum GodilFriend
Messages: 35
Registered: July 2009
Member
Eric Rizzo wrote:

> On 3/25/2009 10:44 AM, Irum Godil wrote:
>> Hi,
>> I did look at the classes mentioned by you, but it does not solve my
>> problem exactly. Basically, I have 2 controls in my form, one is a
>> FormText, and the other can be any SWT/more complex widget.
>> I actually have a series of them, so something like:
>>
>> Label1 Text
>> Label2 Combo
>> Label3 Something more complex
>>
>> Now, what I want is that the tab always comes in the 2nd field, but
>> skips all the labels.
>> If I set e.doit = false, for the labels, then the tab does not continue
>> past the first label. If I set it to true, I see the same behaviour as
>> today.
>> How can I just skip tab from the FormText, but ensure it goes to the
>> next control on the page?

> I don't understand; Label widgets don't take focus (on Windows, at
> least). So the default focus traversal for a Composite should
> automatically find the "next" focusable control.

> Eric

Hi,

In my example, the Labels are actually "FormText" object and they are
taking focus, although I do not see any cursor.

Thanks.
Re: FormText Tabbing. [message #335444 is a reply to message #335235] Wed, 08 April 2009 14:28 Go to previous message
Irum Godil is currently offline Irum GodilFriend
Messages: 35
Registered: July 2009
Member
Hi,

I was wondering if someone was able to think of a solution to this one. I
will appreciate any inputs.

Thanks,
Irum.
Previous Topic:refreshing commands based on workbench selection
Next Topic:Hide filter in FilteredTree
Goto Forum:
  


Current Time: Thu Jul 25 23:19:17 GMT 2024

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

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

Back to the top