Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Check when user changes tabitem
Check when user changes tabitem [message #455855] Fri, 20 May 2005 13:29 Go to next message
Flik is currently offline FlikFriend
Messages: 51
Registered: July 2009
Member
Hello,

is there any possibility to perform an action when an user changes the
selected tabitem?

I want to display a message if the user doesn't fill out all fields. If
he doesn't then he should stay on the active tab, otherwise he "is
allowed" to change it!

can anybody help me??

thx

flik
Re: Check when user changes tabitem [message #455861 is a reply to message #455855] Fri, 20 May 2005 17:29 Go to previous messageGo to next message
Emil Crumhorn is currently offline Emil CrumhornFriend
Messages: 169
Registered: July 2009
Senior Member
tabFolder.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent event) {
switch (tf.getSelectionIndex()) {
case 0:
// first tab was clicked
break;
}
}
}

You get the idea.

Emil


"Flik" <flik04@gmx.de> wrote in message
news:d6koqg$m4g$1@news.eclipse.org...
> Hello,
>
> is there any possibility to perform an action when an user changes the
> selected tabitem?
>
> I want to display a message if the user doesn't fill out all fields. If he
> doesn't then he should stay on the active tab, otherwise he "is allowed"
> to change it!
>
> can anybody help me??
>
> thx
>
> flik
Re: Check when user changes tabitem [message #455908 is a reply to message #455861] Mon, 23 May 2005 07:23 Go to previous messageGo to next message
Flik is currently offline FlikFriend
Messages: 51
Registered: July 2009
Member
thank you emil for your answer,

but i have got the problem that i cannot _stop_ the event.
the idea was that the code should check whether the user filled out the
fields correctly or not. if he doesn't do it correctly then he should
stay on the actual tab. But how can I perform this "stopping action"?

"event.doit = false;" doesn't work!

thx

Flik

Emil Crumhorn schrieb:
> tabFolder.addSelectionListener(new SelectionListener() {
> public void widgetSelected(SelectionEvent event) {
> switch (tf.getSelectionIndex()) {
> case 0:
> // first tab was clicked
> break;
> }
> }
> }
>
> You get the idea.
>
> Emil
>
>
> "Flik" <flik04@gmx.de> wrote in message
> news:d6koqg$m4g$1@news.eclipse.org...
>
>>Hello,
>>
>>is there any possibility to perform an action when an user changes the
>>selected tabitem?
>>
>>I want to display a message if the user doesn't fill out all fields. If he
>>doesn't then he should stay on the active tab, otherwise he "is allowed"
>>to change it!
>>
>>can anybody help me??
>>
>>thx
>>
>>flik
>
>
>
Re: Check when user changes tabitem [message #455943 is a reply to message #455908] Mon, 23 May 2005 18:22 Go to previous messageGo to next message
Emil Crumhorn is currently offline Emil CrumhornFriend
Messages: 169
Registered: July 2009
Senior Member
Can't you just re-select the active tab when they try to click another tab?

Emil

"Flik" <flik04@gmx.de> wrote in message
news:d6s0ii$oli$1@news.eclipse.org...
> thank you emil for your answer,
>
> but i have got the problem that i cannot _stop_ the event.
> the idea was that the code should check whether the user filled out the
> fields correctly or not. if he doesn't do it correctly then he should stay
> on the actual tab. But how can I perform this "stopping action"?
>
> "event.doit = false;" doesn't work!
>
> thx
>
> Flik
>
> Emil Crumhorn schrieb:
>> tabFolder.addSelectionListener(new SelectionListener() {
>> public void widgetSelected(SelectionEvent event) {
>> switch (tf.getSelectionIndex()) {
>> case 0:
>> // first tab was clicked
>> break;
>> }
>> }
>> }
>>
>> You get the idea.
>>
>> Emil
>>
>>
>> "Flik" <flik04@gmx.de> wrote in message
>> news:d6koqg$m4g$1@news.eclipse.org...
>>
>>>Hello,
>>>
>>>is there any possibility to perform an action when an user changes the
>>>selected tabitem?
>>>
>>>I want to display a message if the user doesn't fill out all fields. If
>>>he doesn't then he should stay on the active tab, otherwise he "is
>>>allowed" to change it!
>>>
>>>can anybody help me??
>>>
>>>thx
>>>
>>>flik
>>
>>
Re: Check when user changes tabitem [message #455952 is a reply to message #455943] Tue, 24 May 2005 07:03 Go to previous message
Flik is currently offline FlikFriend
Messages: 51
Registered: July 2009
Member
hello emil,

thank you very much! you are right. why thinking so complicated ....
just keep it simple!

now it runs!

thx

Flik

Emil Crumhorn schrieb:
> Can't you just re-select the active tab when they try to click another tab?
>
> Emil
>
> "Flik" <flik04@gmx.de> wrote in message
> news:d6s0ii$oli$1@news.eclipse.org...
>
>>thank you emil for your answer,
>>
>>but i have got the problem that i cannot _stop_ the event.
>>the idea was that the code should check whether the user filled out the
>>fields correctly or not. if he doesn't do it correctly then he should stay
>>on the actual tab. But how can I perform this "stopping action"?
>>
>>"event.doit = false;" doesn't work!
>>
>>thx
>>
>>Flik
>>
>>Emil Crumhorn schrieb:
>>
>>> tabFolder.addSelectionListener(new SelectionListener() {
>>> public void widgetSelected(SelectionEvent event) {
>>> switch (tf.getSelectionIndex()) {
>>> case 0:
>>> // first tab was clicked
>>> break;
>>> }
>>> }
>>> }
>>>
>>>You get the idea.
>>>
>>>Emil
>>>
>>>
>>>"Flik" <flik04@gmx.de> wrote in message
>>>news:d6koqg$m4g$1@news.eclipse.org...
>>>
>>>
>>>>Hello,
>>>>
>>>>is there any possibility to perform an action when an user changes the
>>>>selected tabitem?
>>>>
>>>>I want to display a message if the user doesn't fill out all fields. If
>>>>he doesn't then he should stay on the active tab, otherwise he "is
>>>>allowed" to change it!
>>>>
>>>>can anybody help me??
>>>>
>>>>thx
>>>>
>>>>flik
>>>
>>>
>
Previous Topic:drop down action?
Next Topic:TableEditor problem
Goto Forum:
  


Current Time: Thu Apr 25 17:20:47 GMT 2024

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

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

Back to the top