Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Select a row without the actual cell selection
Select a row without the actual cell selection [message #1816920] Tue, 12 November 2019 08:19 Go to next message
Alexey Kazakov is currently offline Alexey KazakovFriend
Messages: 2
Registered: November 2019
Junior Member
Hello,

I have a configured NatTable with some custom features. In some cases I want to search the information in the table using the filter, so the entered pattern matches the certain rows in my table and then shows it via applying the selection to the first row. For now I use the method selectRow in the SelectionLayer class and set the column position to the value of -1 so there are not any specific columns to be technically selected (I do need this functional exactly) But the problem shows up when I try to edit selected row even if it is prohibited to edit rows - the NPE is beeing thrown
null
null
Stack Trace:
at org.eclipse.nebula.widgets.nattable.edit.command.EditUtils.allCellsEditable(EditUtils.java:145)
at org.eclipse.nebula.widgets.nattable.edit.command.EditUtils.allCellsEditable(EditUtils.java:126)
at org.eclipse.nebula.widgets.nattable.edit.command.EditSelectionCommandHandler.doCommand(EditSelectionCommandHandler.java:49)
at org.eclipse.nebula.widgets.nattable.edit.command.EditSelectionCommandHandler.doCommand(EditSelectionCommandHandler.java:1)
at org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler.doCommand(AbstractLayerCommandHandler.java:21)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.doCommand(AbstractLayer.java:186)
at org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform.doCommand(AbstractIndexLayerTransform.java:105)
at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.doCommand(SelectionLayer.java:579)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:106)
at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.doCommand(ViewportLayer.java:1071)
at org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform.doCommand(AbstractIndexLayerTransform.java:109)
at org.eclipse.nebula.widgets.nattable.grid.layer.DimensionallyDependentLayer.doCommand(DimensionallyDependentLayer.java:163)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:106)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:106)
at org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.doCommandOnChildLayers(CompositeLayer.java:159)
at org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.doCommand(CompositeLayer.java:151)
at org.eclipse.nebula.widgets.nattable.NatTable.doCommand(NatTable.java:820)
at org.eclipse.nebula.widgets.nattable.edit.action.KeyEditAction.run(KeyEditAction.java:28)
at org.eclipse.nebula.widgets.nattable.ui.mode.ConfigurableModeEventHandler.keyPressed(ConfigurableModeEventHandler.java:35)
at org.eclipse.nebula.widgets.nattable.ui.mode.ModeSupport.keyPressed(ModeSupport.java:91)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:171)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
... some SWT throws

and the similar one with "+" on the NumPad
null
  Exception:
  null
    Stack Trace:
       at org.eclipse.nebula.widgets.nattable.edit.command.EditUtils.allCellsEditable(EditUtils.java:145)
       at org.eclipse.nebula.widgets.nattable.edit.command.EditUtils.allCellsEditable(EditUtils.java:126)
       at org.eclipse.nebula.widgets.nattable.tickupdate.command.TickUpdateCommandHandler.doCommand(TickUpdateCommandHandler.java:60)
       at org.eclipse.nebula.widgets.nattable.tickupdate.command.TickUpdateCommandHandler.doCommand(TickUpdateCommandHandler.java:1)
       at org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler.doCommand(AbstractLayerCommandHandler.java:21)
       at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.doCommand(AbstractLayer.java:186)
... and other throws

So the question is how can I select the row without any technical cell selection.
Any help is appreciated...

Thanks,
Alex
Re: Select a row without the actual cell selection [message #1817113 is a reply to message #1816920] Fri, 15 November 2019 15:19 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2814
Registered: July 2012
Senior Member
I am quite confused about this.

First, which NatTable version are you using? Because I am not able to reproduce this with a current code base.
Second, how do you want to start editing without an active selection anchor?

Quote:
how can I select the row without any technical cell selection


This does not really make sense. Especially if you want to support editing via key bindings. I mean, what should happen if there is no selection anchor? Which cell should be edited? What should happen on pressing the arrow keys?

Actually I am not sure if you really need a selection or if you simply need to highlight the row similar to selection. Because it sounds like you don't want a selection, just a highlighting.
Previous Topic:Unbind cell selection with selected row
Next Topic:Styling Grid : Windows OS Style
Goto Forum:
  


Current Time: Fri Jun 18 05:04:55 GMT 2021

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

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

Back to the top