RMB on a cell returning last selected cell position as null [message #1398161] |
Thu, 10 July 2014 18:16 |
Sunny Messages: 37 Registered: September 2011 |
Member |
|
|
Hi Dirk,
To enable RMB on my nattable I added a uibinding like this:
uiBindingRegistry.registerMouseDownBinding( new MouseEventMatcher( SWT.NONE, GridRegion.BODY,
MouseEventMatcher.RIGHT_BUTTON ), new IMouseAction()
{
@Override
public void run( NatTable natTable, MouseEvent event )
{
int colPosition = LayerUtil.convertColumnPosition( natTable,
natTable.getColumnPositionByX( event.x ), selectionLayer );
int rowPosition = LayerUtil.convertRowPosition( natTable,
natTable.getRowPositionByY( event.y ), selectionLayer );
if( !selectionLayer.isCellPositionSelected( colPosition, rowPosition ) )
{
selectCellAction.run( natTable, event );
}
}
} );
But I found that sometimes the getLastSelectedCellPosition() on selectionLayer returns me null, which is causing some problems in my application.
Is that a correct way to implement RMB binding?
Thanks.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04384 seconds