]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Added identity-providing constructor for IconButtonStyleBase 61/4261/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 1 Jun 2020 05:47:33 +0000 (08:47 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 1 Jun 2020 05:47:33 +0000 (08:47 +0300)
This is needed to support proper implementation of styles inheriting
IconButtonStyleBase. Otherwise query identities of the mentioned class
fall back to getClass which does not work in general.

gitlab #544

Change-Id: I7bfea53b1ce23e644da03ada3cb027fd34a4780a

bundles/org.simantics.diagram/src/org/simantics/diagram/profile/IconButtonStyleBase.java

index f4c9470bdaa6e6465b97543a2ae81469ccdbfc19..4055e8d4aa5ad47fef14bba55cac542d4894c801 100644 (file)
@@ -18,7 +18,15 @@ public abstract class IconButtonStyleBase<T extends IconButtonResult> extends St
 
        abstract protected String getNodePrefix();
        abstract protected Class<?> getNodeClass();
-       
+
+    public IconButtonStyleBase(Object identity) {
+        super(identity);
+    }
+
+    public IconButtonStyleBase() {
+        super();
+    }
+
     private AffineTransform translateAndScaleIfNeeded(AffineTransform tr, Vec2d offset, boolean relativeTransform) {
        if(relativeTransform) {
                if(!offset.isZero()) {