|Enable Eclipse commands based on selections within NatTable [message #898776]
||Fri, 27 July 2012 14:11
| Rashmy A
Registered: July 2009
If we have a Eclipse table, we have the support to enable/disable a toolbar command based on selections within the table since these selections are sent to my command's property tester. I would like to hook up similar capability with NatTable. Could you please suggest how I can send a call to evaluate command handlers when a selection is made within NatTable?
|Re: Enable Eclipse commands based on selections within NatTable [message #899010 is a reply to message #898776]
||Mon, 30 July 2012 07:27
| Dirk Fauth
Registered: July 2012
there are several ways how you can achieve this:
1. It is possible to use the NatTable as an ISelectionProvider. To do this, NatTable brings the RowSelectionProvider. Note that this only works for selection of rows, not cells.
ISelectionProvider selectionProvider =
2. You can hook in your own selection behaviour by implementing ILayerListener and add it to the SelectionLayer. In handleLayerEvent(ILayerEvent) you can check for the selection and activate/deactivate your handler programmatically like described here http://wiki.eclipse.org/Platform_Command_Framework#Handlers
There are examples for creating an ISelectionProvider and ILayerListener in the NatTable examples selection section.
The documentation on selection in NatTable needs to be created. Hopefully we are able to add it soon.
Hope that helps.
Powered by FUDForum
. Page generated in 0.01699 seconds