Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » How to obtain the cellValue in IMouseAction
How to obtain the cellValue in IMouseAction [message #1424735] Tue, 16 September 2014 10:39 Go to next message
Phaedrus The Greek is currently offline Phaedrus The GreekFriend
Messages: 17
Registered: August 2011
Junior Member
Is this the correct method to obtain the Cell's dataValue ?

int sourceColumnPosition = ((NatEventData)event.data).getColumnPosition();			
int sourceRowPosition = ((NatEventData)event.data).getRowPosition();
				
int columnPosition = LayerUtil.convertColumnPosition(natTable, sourceColumnPosition, bodyDataLayer);				
int rowPosition = LayerUtil.convertRowPosition(natTable, sourceRowPosition, bodyDataLayer);
				
Object dataValue = natTable.getDataValueByPosition(columnPosition, rowPosition);


Is there any way to do it without a reference to the bodyLayer ?

Thanks,

Jay
Re: How to obtain the cellValue in IMouseAction [message #1424742 is a reply to message #1424735] Tue, 16 September 2014 10:47 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Is the columnPosition different to the sourceColumnPosition?

IIRC you should get the same result without the position transformation as the mouse event is executed on the visible part and therefore natTable.getDataValueByPosition() should return the correct value using the NatEventData values.
Previous Topic:Possible Bug With Sorting
Next Topic:Use multi cell painters on a single cell
Goto Forum:
  


Current Time: Sat Apr 27 00:27:57 GMT 2024

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

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

Back to the top