Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » CellEditor on DoubleCLick?
CellEditor on DoubleCLick? [message #1008020] Thu, 07 February 2013 21:53 Go to next message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
Registered: July 2012
Senior Member
The cellEditor is triggered on leftclick now.
Is it possible to trigger it on double click?
Re: CellEditor on DoubleCLick? [message #1008386 is a reply to message #1008020] Tue, 12 February 2013 09:30 Go to previous message
Renso Lohuis is currently offline Renso LohuisFriend
Messages: 44
Registered: July 2012
Member
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

Previous Topic:Scroll listener?
Next Topic:Re: Scroll listener?
Goto Forum:
  


Current Time: Fri Apr 26 03:47:47 GMT 2024

Powered by FUDForum. Page generated in 0.02953 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top