Home » Eclipse Projects » NatTable » Best Practice about uncommon table layout(How to add an area between header and body)
| | | | |
Re: Best Practice about uncommon table layout [message #1768575 is a reply to message #1768572] |
Thu, 20 July 2017 07:43 |
Chris Lewold Messages: 13 Registered: July 2017 |
Junior Member |
|
|
Well - if I understand correctly the benefit of the GridLayer is not just the simplification for a 2,2 composite, but also lots of default event handling seems to be done there - exactly the area where I seem to have problems with the checkboxes not being drawn.
Further we have already quite some code (NatTableBuilder classes etc) which internally use GridLayer, and I have to change all these in order to apply our new feature (possibly introducing problems this way, as I forget some event handlers or such).
About events not being fired: in my sample I use the following two classes as configuration on the SETTINGS area. Do you see something which I am obviously missing?
static class EditAreaEditBindings extends AbstractUiBindingConfiguration {
public static final String SETTINGS_REGION = "SETTINGS_REGION";
@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
uiBindingRegistry.registerSingleClickBinding(
new CellEditorMouseEventMatcher(SETTINGS_REGION),
new MouseEditAction());
uiBindingRegistry.registerMouseDragMode(
new CellEditorMouseEventMatcher(SETTINGS_REGION),
new CellEditDragMode());
uiBindingRegistry.registerFirstSingleClickBinding(
new CellPainterMouseEventMatcher(SETTINGS_REGION, MouseEventMatcher.LEFT_BUTTON, CheckBoxPainter.class),
new MouseEditAction());
uiBindingRegistry.registerFirstMouseDragMode(
new CellPainterMouseEventMatcher(SETTINGS_REGION, MouseEventMatcher.LEFT_BUTTON, CheckBoxPainter.class),
new CellEditDragMode());
}
}
static class EditingConfig extends AbstractRegistryConfiguration {
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE,
IEditableRule.ALWAYS_EDITABLE, DisplayMode.EDIT,
ViewSPRPartV1.EDIT_ACTIVE_LABEL);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE,
IEditableRule.ALWAYS_EDITABLE, DisplayMode.EDIT,
ViewSPRPartV1.EDIT_POSITIVE_CONTROL_LABEL);
List<String> controlValues = Arrays.asList("PosCtrl 1", "PosCtrl 2", "PosCtrl 3");
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR,
new ComboBoxCellEditor(controlValues), DisplayMode.EDIT,
ViewSPRPartV1.EDIT_POSITIVE_CONTROL_LABEL);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new ComboBoxPainter(),
DisplayMode.NORMAL, ViewSPRPartV1.EDIT_POSITIVE_CONTROL_LABEL);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new CheckBoxCellEditor(),
DisplayMode.EDIT, ViewSPRPartV1.EDIT_ACTIVE_LABEL);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new CheckBoxPainter(),
DisplayMode.NORMAL, ViewSPRPartV1.EDIT_ACTIVE_LABEL);
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER,
new DefaultBooleanDisplayConverter(), DisplayMode.NORMAL,
ViewSPRPartV1.EDIT_ACTIVE_LABEL);
}
}
|
|
| |
Re: Best Practice about uncommon table layout [message #1768680 is a reply to message #1768597] |
Fri, 21 July 2017 12:18 |
Chris Lewold Messages: 13 Registered: July 2017 |
Junior Member |
|
|
Hello Dirk !
Things are getting more clear now - thanks a lot for your time! I guess I will implement an own Composite being quite similar to GridLayer, just supporting a separate "SETTINGS_REGION".
I will simply create a new NatTableBuilder from our existing ones (they are one of our classes - not the one from your repository) - this way I can be sure not to break existing functionality.
[Updated on: Fri, 21 July 2017 12:19] Report message to a moderator
|
|
| | | | | |
Goto Forum:
Current Time: Wed Sep 25 12:29:19 GMT 2024
Powered by FUDForum. Page generated in 0.04656 seconds
|