Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT List Selection
SWT List Selection [message #629001] Sat, 25 September 2010 19:51 Go to next message
larsk is currently offline larskFriend
Messages: 22
Registered: October 2009
Location: Sweden
Junior Member
I have added a SelectionListener to a SWT List to know when the selection has changed.
But how do I know what was selected before this new selection? Is there any way to get that information?

Edit: If figured it out. Don't know why I didn't figure it out from the beginning. I just stored the List's selection to another variable that I checked the next time I selected the List.

[Updated on: Sat, 25 September 2010 20:21]

Report message to a moderator

Re: SWT List Selection [message #629087 is a reply to message #629001] Mon, 27 September 2010 07:15 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 25.09.2010 21:51, larsk wrote:
> I have added a SelectionListener to a SWT List to know when the
> selection has changed.
> But how do I know what was selected before this new selection? Is there
> any way to get that information?

You have to administrate a selection history by yourself.
Why do you not query the initial selection after the creation
of the widget? Typically you will also intentionally set a
specific initial selection, this is the right place where you
could start with your history.

HTH & Greetings from Bremen,

Daniel Krügler
Previous Topic:Install SWT on Windows 7 64-bit Machine
Next Topic:[resolved] NullPointerException with Button.getSelection()
Goto Forum:
  


Current Time: Thu Dec 18 23:20:23 GMT 2014

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

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