Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » How to do full row selection?
How to do full row selection? [message #1016997] Fri, 08 March 2013 14:19 Go to next message
Joachim Fuchs is currently offline Joachim FuchsFriend
Messages: 34
Registered: February 2013
Member
Hi,
I am building a tree table based on the nat table examples. Heaps of questions on the way... But here is a concrete one:

How do I implement a decent full select row behavior? So far I use the RowSelectionModel with multipleSelectionAllowed = false. I can select single rows only as intended. But clicking the columnheader or clicking a row and dragging the mouse up or down selects more than one.

Any help is appreciated.

J
Re: How to do full row selection? [message #1018216 is a reply to message #1016997] Wed, 13 March 2013 12:24 Go to previous message
Joachim Fuchs is currently offline Joachim FuchsFriend
Messages: 34
Registered: February 2013
Member
Not sure if I made myself clear. So far I managed to turn off the unwanted multi-row selection behaviour like this:
selectionProvider = new RowSelectionProvider(selectionLayer, getRowDataProvider(), false);
selectionProvider.addSelectionChangedListener(new ISelectionChangedListener() {

			@Override
			public void selectionChanged(SelectionChangedEvent event) {
				IStructuredSelection selection = (IStructuredSelection) event.getSelection();
				if (selection.size() > 1) {
					selectionProvider.setSelection(new StructuredSelection(
							new Object[] { selection.toList()
									.get(selection.size() - 1) }));
				}
			}

		});

Previous Topic:configRegistry.registerConfigAttribute dont work on CompositeLayer
Next Topic:How to switch display mode of table cells?
Goto Forum:
  


Current Time: Thu Apr 25 11:40:55 GMT 2024

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

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

Back to the top