]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Allow repeated single clicks to activate property editing 31/3631/1 release/1.40.0
authorReino Ruusu <reino.ruusu@semantum.fi>
Mon, 25 Nov 2019 11:51:50 +0000 (13:51 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 27 Nov 2019 15:38:58 +0000 (15:38 +0000)
gitlab #58

Change-Id: I34c98ec258b08e25cd2aa6305644437804a1cf94
(cherry picked from commit 32b0d23669bb57c4869ea4b761ae821892a14be5)

org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java

index a3fca78bb4206dc18adafa617073919702042778..b6661c4af46b8d0702739cee1cf71e081bc74832 100644 (file)
@@ -501,10 +501,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;
                                }