ave4496
ave4496

Reputation: 3018

Add listener to TableViewer editing column

Is it possible to add a listener to the column where editing is enabled?

I enabled editing support and would like to add a keylistener to be able to track live changes but I can't find anything

Upvotes: 0

Views: 942

Answers (1)

greg-449
greg-449

Reputation: 111142

If your EditingSupport class is using the TextCellEditor you can replace that with a class extending TextCellEditor to gain access to the Text control and various predefined methods.

The Text control in TextCellEditor is stored in a field called text which you can access from your sub-class.

TextCellEditor already has a key listener and defines a:

protected void keyReleaseOccured(KeyEvent keyEvent)

method that you can override. Be sure to call super.keyReleaseOccured(keyEvent) if you override this as there is important code in this method.

Upvotes: 3

Related Questions