Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Way to detect table cell clicks?
Way to detect table cell clicks? [message #1577257] Wed, 21 January 2015 20:08 Go to next message
Nejc Gasper is currently offline Nejc GasperFriend
Messages: 55
Registered: July 2014
Member
So I need to have table cells clickable/selectable. For starters it will do if I can detect a table-cell click. Is there a way to do that? I know there is the possibility of having editable columns and I guess there must be some mechanism to support cell click detection for that, I just do not see any way to hook into that (yet).

Thanks for any help
Re: Way to detect table cell clicks? [message #1578063 is a reply to message #1577257] Thu, 22 January 2015 06:56 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 566
Registered: October 2012
Location: Bern, Switzerland
Senior Member
You can add a property change listener for column changes to your table and store the column in which the cursor currently is in a member of your TableField

getTable().addPropertyChangeListener(ITable.PROP_CONTEXT_COLUMN, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
currentColumn = evt.getNewValue();
}
});

Then in the execRowClick() and/or execRowAction() method of your table field you can compare this member against the columns you want to have clickable. The combination of row (passed into the methods) and column (kept up to date using the listener) you can then determine in which cell the click happened.
Re: Way to detect table cell clicks? [message #1578524 is a reply to message #1578063] Thu, 22 January 2015 12:56 Go to previous messageGo to next message
Nejc Gasper is currently offline Nejc GasperFriend
Messages: 55
Registered: July 2014
Member
Yes, this is just what I wanted. Thanks for answering on such a short notice!
Re: Way to detect table cell clicks? [message #1585308 is a reply to message #1578524] Mon, 26 January 2015 07:33 Go to previous message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 566
Registered: October 2012
Location: Bern, Switzerland
Senior Member
You're welcome, I'm glad I could help.
Previous Topic:Controlling if execChangedValue() is called or not.
Next Topic:Width in Pixel
Goto Forum:
  


Current Time: Fri Oct 20 03:27:11 GMT 2017

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

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