X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fserializing%2FIndirectGUIComponentCreator.java;h=0e89af7b875dd427aa00b8656612437cac46a4a1;hb=05f3deb7ee3a0b7162c75e1963be9a739618e3df;hp=456d19c10dd5093c93e714270f7df888aa68ebf6;hpb=0885062ad73925732b1a4e4c79f910dec9862fd3;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/serializing/IndirectGUIComponentCreator.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/serializing/IndirectGUIComponentCreator.java index 456d19c1..0e89af7b 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/serializing/IndirectGUIComponentCreator.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/serializing/IndirectGUIComponentCreator.java @@ -16,7 +16,7 @@ public class IndirectGUIComponentCreator { private static final Map standardComponentIDs = new HashMap<>(); - private static final Map componentProviders = new HashMap<>(); + private static final Map componentSuppliers = new HashMap<>(); static { @@ -51,9 +51,9 @@ public class IndirectGUIComponentCreator standardComponentIDs.put(standardComponentID, associatedComponentID); } - public static void setComponentProvider(String className, ComponentProvider componentProvider) + public static void setComponentSupplier(String className, ComponentSupplier componentSupplier) { - componentProviders.put(className, componentProvider); + componentSuppliers.put(className, componentSupplier); } public static GUIComponent createComponent(ViewModelModifiable model, String id) @@ -74,15 +74,15 @@ public class IndirectGUIComponentCreator { String className = resolvedID.substring(6); tryLoadComponentClass(className); - ComponentProvider componentProvider = componentProviders.get(className); - if (componentProvider != null) - return componentProvider.create(model, params); + ComponentSupplier componentSupplier = componentSuppliers.get(className); + if (componentSupplier != null) + return componentSupplier.create(model, params); } else // we know id has to start with "file:" here // because standardComponentIDs only contains strings starting with "class:" or "file:" return SubmodelComponentDeserializer.create(model, resolvedID.substring(5)); } - throw new RuntimeException("Could not get component provider for ID " + id); + throw new RuntimeException("Could not get component supplier for ID " + id); } private static void tryLoadComponentClass(String componentClassName) @@ -90,7 +90,7 @@ public class IndirectGUIComponentCreator CodeSnippetSupplier.tryInvokeStaticInitializer(componentClassName, "Error loading component class %s: %s\n"); } - public static interface ComponentProvider + public static interface ComponentSupplier { public GUIComponent create(ViewModelModifiable model, JsonElement params); }