This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

(SWT) Show specific part of multiselect list  RSS feed

 
Peter Frisch
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to show a sepcific part in a SWT multiselection list. list.showSelection() won't do the trick, becaus it just shows the beginning of the selection and I want to show some selected items in the middle of the selection.

Thanks for any hints
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I have never worked with SWT, but presuming its similarities with Swing, one way of meeting your requirement is to change the sequence of your list items. Selected items are grouped together at the start of the list.

Does this answer your question or did I misunderstand your requirement?
 
Peter Frisch
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestion,

that kind of would solve my problem, but it's not quite a nice solution. If there is a way to control what part of a list to display, I would prefer that to changing the (alphabetically sorted) list of names in the list.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well JList has a ensureIndexIsVisible(int index)
 
Lance Colton
Ranch Hand
Posts: 64
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried SWT's List.getSelectionIndices()

(I think this is what you're asking at least)

http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTListSelectionEvent.htm
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!