Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Combo clearSelection
Combo clearSelection [message #458535] Thu, 14 July 2005 17:00 Go to next message
Eclipse UserFriend
Originally posted by: ted_slusser.yahoo.com

Hi, I'm calling select(0) on my combos to have the first element appear in
the list. When I do this it selects all the text in the Combo line. Is
it possible to select the first element without selecting all the text?
When I call clearSelection it doesn't clear the selected text.

Thanks,

Ted
Re: Combo clearSelection [message #458667 is a reply to message #458535] Mon, 18 July 2005 21:29 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Combo.clearSelection() should just clear the selection, not delete the text.
If your combo is read only, then the text will always match the selection.

"T Slusser" <ted_slusser@yahoo.com> wrote in message
news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
> Hi, I'm calling select(0) on my combos to have the first element appear in
> the list. When I do this it selects all the text in the Combo line. Is
> it possible to select the first element without selecting all the text?
> When I call clearSelection it doesn't clear the selected text.
>
> Thanks,
>
> Ted
>
Re: Combo clearSelection [message #458711 is a reply to message #458667] Tue, 19 July 2005 19:30 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
Hi Steve,

Thanks for your reply. The combo box is read-write. I'm not trying to
actually delete the text just clear the selection. The problem occurs if I
have multiple combo boxes on the screen (all read-write) and I call
select(0) on each of them. It appears that all the combo boxes have focus.
What I mean is that the text is selected on all of the combo boxes at the
same time. I'm not sure if this makes sense, but the clearSelection method
does not actually 'deselect' the text.

Thanks,

Ted
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:dbh6uo$or3$1@news.eclipse.org...
> Combo.clearSelection() should just clear the selection, not delete the
> text.
> If your combo is read only, then the text will always match the selection.
>
> "T Slusser" <ted_slusser@yahoo.com> wrote in message
> news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
>> Hi, I'm calling select(0) on my combos to have the first element appear
>> in
>> the list. When I do this it selects all the text in the Combo line. Is
>> it possible to select the first element without selecting all the text?
>> When I call clearSelection it doesn't clear the selected text.
>>
>> Thanks,
>>
>> Ted
>>
>
>
Re: Combo clearSelection [message #458736 is a reply to message #458711] Wed, 20 July 2005 12:21 Go to previous messageGo to next message
Alex Shneyderman is currently offline Alex ShneydermanFriend
Messages: 71
Registered: July 2009
Member
I think you can use

setSelection (new Point(0,0));

to deselect the text

"Ted" <ted_slusser@yahoo.com> wrote in message
news:dbjkd4$i7k$1@news.eclipse.org...
> Hi Steve,
>
> Thanks for your reply. The combo box is read-write. I'm not trying to
> actually delete the text just clear the selection. The problem occurs if
> I have multiple combo boxes on the screen (all read-write) and I call
> select(0) on each of them. It appears that all the combo boxes have
> focus. What I mean is that the text is selected on all of the combo boxes
> at the same time. I'm not sure if this makes sense, but the
> clearSelection method does not actually 'deselect' the text.
>
> Thanks,
>
> Ted
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:dbh6uo$or3$1@news.eclipse.org...
>> Combo.clearSelection() should just clear the selection, not delete the
>> text.
>> If your combo is read only, then the text will always match the
>> selection.
>>
>> "T Slusser" <ted_slusser@yahoo.com> wrote in message
>> news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
>>> Hi, I'm calling select(0) on my combos to have the first element appear
>>> in
>>> the list. When I do this it selects all the text in the Combo line. Is
>>> it possible to select the first element without selecting all the text?
>>> When I call clearSelection it doesn't clear the selected text.
>>>
>>> Thanks,
>>>
>>> Ted
>>>
>>
>>
>
>
Re: Combo clearSelection [message #458755 is a reply to message #458736] Wed, 20 July 2005 16:49 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
Hi Alex,

Thanks for your suggestion. I have tried that and it doesn't work. However
if I add a focus listener and call this on the focus gained event then it
works. The funny thing is if I have several of these combo boxes on the
screen and have this event listener registered for each, it only works on a
single combo. Besides this seems like a real hacky way to do it. I'm
curious to know why clearSelection doesn't work? If I change to read-only
combo the problem goes away, but we'd like to use a Type Ahead feature for
combo and it must be read-write for this to work.

Thanks,

Ted


"Alex Shneyderman" <alex@law.columbia.edu> wrote in message
news:dblfr7$duj$3@news.eclipse.org...
>I think you can use
>
> setSelection (new Point(0,0));
>
> to deselect the text
>
> "Ted" <ted_slusser@yahoo.com> wrote in message
> news:dbjkd4$i7k$1@news.eclipse.org...
>> Hi Steve,
>>
>> Thanks for your reply. The combo box is read-write. I'm not trying to
>> actually delete the text just clear the selection. The problem occurs if
>> I have multiple combo boxes on the screen (all read-write) and I call
>> select(0) on each of them. It appears that all the combo boxes have
>> focus. What I mean is that the text is selected on all of the combo boxes
>> at the same time. I'm not sure if this makes sense, but the
>> clearSelection method does not actually 'deselect' the text.
>>
>> Thanks,
>>
>> Ted
>> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
>> news:dbh6uo$or3$1@news.eclipse.org...
>>> Combo.clearSelection() should just clear the selection, not delete the
>>> text.
>>> If your combo is read only, then the text will always match the
>>> selection.
>>>
>>> "T Slusser" <ted_slusser@yahoo.com> wrote in message
>>> news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
>>>> Hi, I'm calling select(0) on my combos to have the first element appear
>>>> in
>>>> the list. When I do this it selects all the text in the Combo line.
>>>> Is
>>>> it possible to select the first element without selecting all the text?
>>>> When I call clearSelection it doesn't clear the selected text.
>>>>
>>>> Thanks,
>>>>
>>>> Ted
>>>>
>>>
>>>
>>
>>
>
>
Re: Combo clearSelection [message #458757 is a reply to message #458711] Wed, 20 July 2005 18:29 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Are you seeing this?

https://bugs.eclipse.org/bugs/show_bug.cgi?id=93938

"Ted" <ted_slusser@yahoo.com> wrote in message
news:dbjkd4$i7k$1@news.eclipse.org...
> Hi Steve,
>
> Thanks for your reply. The combo box is read-write. I'm not trying to
> actually delete the text just clear the selection. The problem occurs if
I
> have multiple combo boxes on the screen (all read-write) and I call
> select(0) on each of them. It appears that all the combo boxes have
focus.
> What I mean is that the text is selected on all of the combo boxes at the
> same time. I'm not sure if this makes sense, but the clearSelection
method
> does not actually 'deselect' the text.
>
> Thanks,
>
> Ted
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:dbh6uo$or3$1@news.eclipse.org...
> > Combo.clearSelection() should just clear the selection, not delete the
> > text.
> > If your combo is read only, then the text will always match the
selection.
> >
> > "T Slusser" <ted_slusser@yahoo.com> wrote in message
> > news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
> >> Hi, I'm calling select(0) on my combos to have the first element appear
> >> in
> >> the list. When I do this it selects all the text in the Combo line.
Is
> >> it possible to select the first element without selecting all the text?
> >> When I call clearSelection it doesn't clear the selected text.
> >>
> >> Thanks,
> >>
> >> Ted
> >>
> >
> >
>
>
Re: Combo clearSelection [message #458785 is a reply to message #458757] Thu, 21 July 2005 11:47 Go to previous messageGo to next message
Ted is currently offline TedFriend
Messages: 22
Registered: July 2009
Junior Member
Yes, that's the behavior I'm seeing. Sorry for not finding the bugzilla.
The only work around I have currently is to make the combo-boxes read-only.
If this is a Windows bug that's fine. I just needed to exhaust all
possibilities.

Thanks,

Ted
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:dbm55d$bgq$1@news.eclipse.org...
> Are you seeing this?
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=93938
>
> "Ted" <ted_slusser@yahoo.com> wrote in message
> news:dbjkd4$i7k$1@news.eclipse.org...
>> Hi Steve,
>>
>> Thanks for your reply. The combo box is read-write. I'm not trying to
>> actually delete the text just clear the selection. The problem occurs if
> I
>> have multiple combo boxes on the screen (all read-write) and I call
>> select(0) on each of them. It appears that all the combo boxes have
> focus.
>> What I mean is that the text is selected on all of the combo boxes at the
>> same time. I'm not sure if this makes sense, but the clearSelection
> method
>> does not actually 'deselect' the text.
>>
>> Thanks,
>>
>> Ted
>> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
>> news:dbh6uo$or3$1@news.eclipse.org...
>> > Combo.clearSelection() should just clear the selection, not delete the
>> > text.
>> > If your combo is read only, then the text will always match the
> selection.
>> >
>> > "T Slusser" <ted_slusser@yahoo.com> wrote in message
>> > news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
>> >> Hi, I'm calling select(0) on my combos to have the first element
>> >> appear
>> >> in
>> >> the list. When I do this it selects all the text in the Combo line.
> Is
>> >> it possible to select the first element without selecting all the
>> >> text?
>> >> When I call clearSelection it doesn't clear the selected text.
>> >>
>> >> Thanks,
>> >>
>> >> Ted
>> >>
>> >
>> >
>>
>>
>
>
Re: Combo clearSelection [message #458876 is a reply to message #458785] Mon, 25 July 2005 14:21 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
It's a Windows bug that I have been unable to work around. It's a tough
one.

"Ted" <ted_slusser@yahoo.com> wrote in message
news:dbo210$9ah$1@news.eclipse.org...
> Yes, that's the behavior I'm seeing. Sorry for not finding the bugzilla.
> The only work around I have currently is to make the combo-boxes
read-only.
> If this is a Windows bug that's fine. I just needed to exhaust all
> possibilities.
>
> Thanks,
>
> Ted
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:dbm55d$bgq$1@news.eclipse.org...
> > Are you seeing this?
> >
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=93938
> >
> > "Ted" <ted_slusser@yahoo.com> wrote in message
> > news:dbjkd4$i7k$1@news.eclipse.org...
> >> Hi Steve,
> >>
> >> Thanks for your reply. The combo box is read-write. I'm not trying to
> >> actually delete the text just clear the selection. The problem occurs
if
> > I
> >> have multiple combo boxes on the screen (all read-write) and I call
> >> select(0) on each of them. It appears that all the combo boxes have
> > focus.
> >> What I mean is that the text is selected on all of the combo boxes at
the
> >> same time. I'm not sure if this makes sense, but the clearSelection
> > method
> >> does not actually 'deselect' the text.
> >>
> >> Thanks,
> >>
> >> Ted
> >> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> >> news:dbh6uo$or3$1@news.eclipse.org...
> >> > Combo.clearSelection() should just clear the selection, not delete
the
> >> > text.
> >> > If your combo is read only, then the text will always match the
> > selection.
> >> >
> >> > "T Slusser" <ted_slusser@yahoo.com> wrote in message
> >> > news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
> >> >> Hi, I'm calling select(0) on my combos to have the first element
> >> >> appear
> >> >> in
> >> >> the list. When I do this it selects all the text in the Combo line.
> > Is
> >> >> it possible to select the first element without selecting all the
> >> >> text?
> >> >> When I call clearSelection it doesn't clear the selected text.
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Ted
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>
Previous Topic:WebStart SWT java.library.path problem
Next Topic:Using FormLayout cannot get the actual size
Goto Forum:
  


Current Time: Fri Mar 29 00:15:54 GMT 2024

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

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

Back to the top