From 508f88f73c8ca0b7537005d313b3c970877a574c Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Thu, 5 Dec 2019 13:56:16 +0200 Subject: [PATCH] Allow property editing with just a single mouse click gitlab #62 Change-Id: Idcbc1644787316cced9d90481d44759fd754325a --- .../AnnotatedPropertyTabContributorFactory.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java b/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java index 15b787d6..3fcb19f5 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java +++ b/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java @@ -599,23 +599,12 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri } ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy( viewer) { - Object lastSource = null; - int clickCount = 0; - protected boolean isEditorActivationEvent( ColumnViewerEditorActivationEvent event) { - if (!event.getSource().equals(lastSource)) - clickCount = 0; - - lastSource = event.getSource(); - - if (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION) - clickCount += 1; - return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL + || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION - || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION && clickCount >= 2 - || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR) + || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && (event.keyCode == SWT.CR || event.keyCode == SWT.F2)) || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC; } }; -- 2.45.2