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 Fuchs
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 Fuchs
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:Updating the structure of a CompositLayer?
Next Topic:How to uncheck CheckBoxCellEditor?
Goto Forum:
  


Current Time: Fri Oct 31 05:08:34 GMT 2014

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

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