activateCell() method doesn't get called [message #1084930] |
Mon, 12 August 2013 08:22 |
Ali Malik Messages: 27 Registered: August 2013 |
Junior Member |
|
|
Hi,
I am using a custom editor for the NatTable.
I need to show a combo box editor in selective cells of a column, not all of them.
For this, I decided to use a custom editor, which implements the ICellEditor Interface.
I overrode the public Control activateCell(Composite , Object , Character EditModeEnum , ICellEditHandler , ILayerCell ,IConfigRegistry )
Though, I haven't yet implemented the functionality, but the method should be called when i select the cell.
I call it like this:
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR, new CustomEditor(),
DisplayMode.NORMAL, QueryTreeTable.COLUMN_TWO_LABEL);
Any suggestions on what am I doing wrong?
|
|
|
|
Re: activateCell() method doesn't get called [message #1085659 is a reply to message #1085114] |
Tue, 13 August 2013 07:28 |
Ali Malik Messages: 27 Registered: August 2013 |
Junior Member |
|
|
I meant some cells should show TextPainter, and some should show ComboBoxPainter.
That EDIT or NORMAL weren't a problem.
I got it solved by reading another thread.
The problem was i had to bind the Custom Editor with the UiBindingRegistry. I did it and it is working fine, now, with the following code.
CustomEditor editor = new CustomEditor( bodyDataProvider, configRegistry );
UiBindingRegistry uiBindingRegistry = natTable.getUiBindingRegistry();
uiBindingRegistry.registerFirstSingleClickBinding(
new BodyCellEditorMouseEventMatcher(editor.getClass()),
new MouseEditAction());
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR, editor,
DisplayMode.NORMAL, QueryTreeTable.COLUMN_TWO_LABEL);
Thank you for your help, Dirk. Do you know any reason why do we have to bind it like this? I mean why doens't it bind it through some internal mechanism?
Regards,
Ali Ahmad Malik
|
|
|
|
Powered by
FUDForum. Page generated in 0.02942 seconds