1 package sourceforge.org.qmc2.options.editor.ui; 2 3 import org.eclipse.jface.viewers.ColumnViewer; 4 import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; 5 import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy; 6 import org.eclipse.swt.SWT; 7 8 public class QMC2EditorActivationStrategy extends 9 ColumnViewerEditorActivationStrategy { 10 QMC2EditorActivationStrategy(ColumnViewer viewer)11 public QMC2EditorActivationStrategy(ColumnViewer viewer) { 12 super(viewer); 13 setEnableEditorActivationWithKeyboard(true); 14 } 15 16 @Override isEditorActivationEvent( ColumnViewerEditorActivationEvent event)17 protected boolean isEditorActivationEvent( 18 ColumnViewerEditorActivationEvent event) { 19 return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL 20 || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION 21 || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC 22 || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && (event.keyCode == SWT.CR || event.keyCode == SWT.KEYPAD_CR)); 23 } 24 } 25