From: Reino Ruusu Date: Mon, 25 Nov 2019 11:51:50 +0000 (+0200) Subject: Allow repeated single clicks to activate property editing X-Git-Tag: v1.43.0~112 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=32b0d23669bb57c4869ea4b761ae821892a14be5;p=simantics%2F3d.git Allow repeated single clicks to activate property editing gitlab #58 Change-Id: I34c98ec258b08e25cd2aa6305644437804a1cf94 --- 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 73526d1c..344dd8ca 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java +++ b/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java @@ -599,10 +599,22 @@ 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_DOUBLE_CLICK_SELECTION + || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION && clickCount >= 2 || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR) || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC; }