Way to detect table cell clicks? [message #1577257] |
Wed, 21 January 2015 20:08  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05784 seconds