You change the default edit bindings by finding the
DefaultEditBindings
And change it to your own and replace the single click binding by double click binding.
I did the same and mine looks like this: (I did some other changes as well to make sure that you also can edit with upper case and by pressing space)
public class ExtendedEditBindings extends AbstractUiBindingConfiguration {
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.F2), new KeyEditAction());
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.SPACE), new KeyEditAction());
uiBindingRegistry.registerKeyBinding(new LetterOrDigitKeyEventMatcher(), new KeyEditAction());
uiBindingRegistry.registerKeyBinding(new LetterOrDigitKeyEventMatcher(SWT.SHIFT), new KeyEditAction());
uiBindingRegistry.registerDoubleClickBinding(new BodyCellEditorMouseEventMatcher(TextCellEditor.class), new MouseEditAction());
uiBindingRegistry.registerDoubleClickBinding(new CellPainterMouseEventMatcher(
GridRegion.BODY,
MouseEventMatcher.LEFT_BUTTON,
CheckBoxPainter.class), new MouseEditAction());
uiBindingRegistry.registerDoubleClickBinding(new BodyCellEditorMouseEventMatcher(ComboBoxCellEditor.class), new MouseEditAction());
uiBindingRegistry.registerDoubleClickBinding(
new BodyCellEditorMouseEventMatcher(MultiComboBoxCellEditor.class),
new MouseEditAction());
}
}
Then find the DefaultGridLayerConfiguration change it to your own and add your own EditBindings
protected void addEditingUIConfig() {
addConfiguration(new ExtendedEditBindings());
}
And use this as grid layer configuration
gridLayer.addConfiguration(new ExtendedGridLayerConfiguration(gridLayer));
[Updated on: Tue, 12 February 2013 09:31]
Report message to a moderator