• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

(SWT) Show specific part of multiselect list

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well JList has a ensureIndexIsVisible(int index)
 
Ranch Hand
Posts: 64
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic