Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Row Selection(Row Selection)
Row Selection [message #988775] Mon, 03 December 2012 06:05 Go to next message
Eclipse UserFriend
This is probably a simple problem but my NatTable is not highlighting selected row when I click on the row header. I also want to enable multi-row selection. What am I missing.
Re: Row Selection [message #988784 is a reply to message #988775] Mon, 03 December 2012 07:46 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
How did you instantiate the SelectionLayer? It sounds like an issue with the row header layer dependency.
Re: Row Selection [message #988924 is a reply to message #988784] Mon, 03 December 2012 19:08 Go to previous messageGo to next message
Eclipse UserFriend
I am creating my own GlazedList where each row is a HistoryItem:

EventList<HistoryItem> eventList = GlazedLists.eventList(model.getHistoryList());
FilterList<HistoryItem> filterList = new FilterList<HistoryItem>(eventList);
SortedList<HistoryItem> sortedList = new SortedList<HistoryItem> (filterList, null);

IColumnPropertyAccessor<HistoryItem> columnPropertyAccessor = new
ReflectiveColumnPropertyAccessor<HistoryItem>(propertyNames);

ListDataProvider<HistoryItem> bodyDataProvider = new ListDataProvider<HistoryItem>
(sortedList, columnPropertyAccessor);
DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
GlazedListsEventLayer<HistoryItem> glazedListsEventLayer = new
GlazedListsEventLayer<HistoryItem>(bodyDataLayer, eventList);
DefaultBodyLayerStack bodyLayerStack = new
DefaultBodyLayerStack(glazedListsEventLayer);
SelectionLayer selectionLayer = bodyLayerStack.getSelectionLayer();

...
Here is my RowHeaderLayer:
IDataProvider rowHeaderDataProvider = new
DefaultRowHeaderDataProvider(bodyDataProvider);
IUniqueIndexLayer rowHeaderDataLayer = new
DefaultRowHeaderDataLayer(rowHeaderDataProvider);
RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
bodyDataLayer, selectionLayer);

Thanks for your help,
Re: Row Selection [message #989008 is a reply to message #988924] Tue, 04 December 2012 10:04 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Well this looks reasonable. At least the parts you posted. If it doesn't work, than maybe you forgot to link your layers correctly to the GridLayer you are using?

Have a look at the DefaultGridLayer. There the init method does the similar thing you are trying to do. Maybe it is just a typo in setting the references.
Re: Row Selection [message #989161 is a reply to message #989008] Tue, 04 December 2012 22:40 Go to previous message
Eclipse UserFriend
Thanks for the reply. I finally had to start over and got it to work. I guess I had a bad reference as you suggested.
Previous Topic:Subclasing TextPainter - chanigng colors is impossible
Next Topic:p2-Repository for NatTable
Goto Forum:
  


Current Time: Thu Apr 25 23:26:26 GMT 2024

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

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

Back to the top