X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fproperty%2FAnnotatedPropertyTabContributorFactory.java;h=344dd8cabc1be4805f46f07d46d3025252b880a7;hb=32b0d23669bb57c4869ea4b761ae821892a14be5;hp=65b267cb6b96017eb49cf3ece8a92650433c025f;hpb=2a4aa4460d5df9da6b348adb2f5ba8c46b071520;p=simantics%2F3d.git 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 65b267cb..344dd8ca 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java +++ b/org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java @@ -76,7 +76,6 @@ import org.simantics.g3d.property.annotations.GetPropertyValue; import org.simantics.g3d.property.annotations.PropertyTabBlacklist; import org.simantics.g3d.property.annotations.SetComboPropertyValue; import org.simantics.g3d.property.annotations.SetPropertyValue; -import org.simantics.g3d.scenegraph.IG3DNode; import org.simantics.g3d.scenegraph.NodeMap; import org.simantics.g3d.scenegraph.NodeMapProvider; import org.simantics.g3d.scenegraph.base.INode; @@ -600,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; } @@ -682,7 +693,7 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri if (nodeMap != null) break; } - n = (IG3DNode)n.getParent(); + n = (INode)n.getParent(); } boolean readOnly = (node instanceof IStructuralNode && ((IStructuralNode)node).isPartOfInstantiatedModel() && !((IStructuralNode)node).isInstantiatedModelRoot());