|Select column upon RMB click [message #890581]
||Fri, 22 June 2012 15:45
| Rashmy A
Registered: July 2009
Firstly congratulations on your move to Eclipse!! This is great!|
Now to the question
I'm trying to select the entire column when user does RMB click on one of the column header cells. This is to ensure that the user knows on what column the menu is going to be applied.
Currently only the left mouse click is registered to select the full column when user clicks on one of the header cells. The right mouse click is registered to open the popup menu.
To achieve my requirements, I created MyTestPopupMenuAction that extends from PopupMenuAction. Then attempted to fire a column selection command. But no column is selected since it fails the conversion within SelectColumnCommandHandler.
Could you please take a look at the code below and let know what additional conversions are required?
public class MyTestPopupMenuAction
public void run( NatTable natTable, MouseEvent event )
NatEventData eventData = NatEventData.createInstanceFromEvent( event );
int columnPosition = eventData.getColumnPosition();
int rowPosition = eventData.getRowPosition();
natTable.doCommand( new SelectColumnCommand( natTable,
columnPosition, rowPosition, false, false ) );
super.run( natTable, event );
With the above code, it fails in SelectColumnCommandHandler.doCommand() when it invokes command.convertToTargetLayer(selectionLayer)). It is not able to match the selection positions with target layer (which I sent in as nattable).
Powered by FUDForum
. Page generated in 0.01448 seconds