• Post Reply Bookmark Topic Watch Topic
  • New Topic

Focuslost listener for TableViewer  RSS feed

 
anjali ray
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an editable tableviewer. I want to sort the rows with the date value entered in the columns but when the user has lost focus on the row i.e. I want to do the sorting when the user has clicked onto a different row.
How do I add a focuslost listener to a TableViewer.
Thanks for any help.
 
Rish Jain
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anjali,

You need to implement ListSelectionListener. To implement it use table.getSelectionModel().addListSelectionListener(selectionListnere), where selectionListnere is a ListSelectionListener where you will have to override valueChanged() method.

valueChanged() method will be called as and when you change the row.

Hope it will help you.
cheers
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!