Merge commit '28314e7a9a3c3ebfcc4db8e9f1875507063ae6e6' into development
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / GUIComponent.java
index 5f74dad..7254d8b 100644 (file)
@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Consumer;
+import java.util.function.Supplier;
 
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
@@ -23,6 +24,8 @@ public abstract class GUIComponent
        private final List<Runnable> redrawListeners;
 
        private final Runnable redrawListenerForSubcomponents;
+       // Defines how the GUIComponent is referenced in SubmodelComponentParams
+       protected Supplier<String> identifierDelegate = () -> "class:".concat(getClass().getCanonicalName());
 
        public GUIComponent(ViewModelModifiable model)
        {
@@ -130,8 +133,11 @@ public abstract class GUIComponent
                callRedrawListeners();
        }
 
+       /**
+        * @return an identifier used to reference this GUIComponent inside of {@link SubmodelComponentParams}
+        */
        public String getIdentifier()
        {
-               return "class:".concat(getClass().getCanonicalName());
+               return identifierDelegate.get();
        }
 }
\ No newline at end of file