Switched mostly to using deserialized component versions
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / serializing / IndirectGUIComponentCreator.java
index ba713bd..456d19c 100644 (file)
@@ -6,6 +6,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import com.google.gson.JsonElement;
+import com.google.gson.JsonNull;
 
 import net.mograsim.logic.ui.model.ViewModelModifiable;
 import net.mograsim.logic.ui.model.components.GUIComponent;
@@ -55,6 +56,11 @@ public class IndirectGUIComponentCreator
                componentProviders.put(className, componentProvider);
        }
 
+       public static GUIComponent createComponent(ViewModelModifiable model, String id)
+       {
+               return createComponent(model, id, JsonNull.INSTANCE);
+       }
+
        public static GUIComponent createComponent(ViewModelModifiable model, String id, JsonElement params)
        {
                if (id != null)
@@ -81,7 +87,7 @@ public class IndirectGUIComponentCreator
 
        private static void tryLoadComponentClass(String componentClassName)
        {
-               CodeSnippetSupplier.tryLoadClass(componentClassName, "Error loading component class %s\n");
+               CodeSnippetSupplier.tryInvokeStaticInitializer(componentClassName, "Error loading component class %s: %s\n");
        }
 
        public static interface ComponentProvider