Class ObjectFactory

java.lang.Object
com.smartgwt.client.util.ObjectFactory

public final class ObjectFactory extends Object
This class contains static utility methods to map between SmartClient objects/types and Smart GWT objects/classes.
  • Method Details

    • createCanvas

      public static final <T extends BaseWidget> T createCanvas(String smartClientClassName, JavaScriptObject javaScriptObject)
      This method will create a Smart GWT object from the provided javaScriptObject and smartClientClassName. It is possible that null will be returned.
      Returns:
    • createFormItem

      public static final <T extends RefDataClass> T createFormItem(String smartClientClassName, JavaScriptObject javaScriptObject)
      This method will create a SmartGWT class from the javaScriptObject and smartClientClassName provided. It is possible that null will be returned.
      Returns:
    • createDataClass

      public static <T extends DataClass> T createDataClass(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault)
    • createBaseClass

      public static <T extends BaseClass> T createBaseClass(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault)
    • createInstance

      public static Object createInstance(String scClassName, JavaScriptObject jsObj)
    • getSmartGWTClassFQN

      public static final String getSmartGWTClassFQN(String smartClientClassName)
      The SmartClient class name used to lookup the corresponding SmartGWT class, which is then returned. Because this method is generic you can return whatever type you'are expecting. So it is completely appropriate to do the following, as no casting is necessary.
       Button myButton = ObjectRegistry.getSmartGWTClass("Button");
      
      Parameters:
      smartClientClassName -
      Returns:
      SmartGWT class or null
    • getSmartGWTClass

      public static final Class<?> getSmartGWTClass(String smartClientClassName)
      This method is a convenience for calling @{link #getSmartGWTClass}.getName();
      Parameters:
      smartClientClassName -
      Returns:
      SmartGWT class fully qualified name or null