From: Reino Ruusu Date: Thu, 5 Dec 2019 11:56:16 +0000 (+0200) Subject: Allow property editing with just a single mouse click X-Git-Tag: v1.43.0~95^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=508f88f73c8ca0b7537005d313b3c970877a574c;p=simantics%2F3d.git Allow property editing with just a single mouse click gitlab #62 Change-Id: Idcbc1644787316cced9d90481d44759fd754325a --- 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; } };