Package com.smartgwt.client.util
Class ObjectFactory
java.lang.Object
com.smartgwt.client.util.ObjectFactory
This class contains static utility methods to map between SmartClient objects/types and Smart GWT objects/classes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends BaseClass>
TcreateBaseClass
(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault) static final <T extends BaseWidget>
TcreateCanvas
(String smartClientClassName, JavaScriptObject javaScriptObject) This method will create a Smart GWT object from the provided javaScriptObject and smartClientClassName.static <T extends DataClass>
TcreateDataClass
(String smartClientClassName, JavaScriptObject javaScriptObject, boolean createDefault) static final <T extends RefDataClass>
TcreateFormItem
(String smartClientClassName, JavaScriptObject javaScriptObject) This method will create a SmartGWT class from the javaScriptObject and smartClientClassName provided.static Object
createInstance
(String scClassName, JavaScriptObject jsObj) static final Class<?>
getSmartGWTClass
(String smartClientClassName) This method is a convenience for calling @{link #getSmartGWTClass}.getName();static final String
getSmartGWTClassFQN
(String smartClientClassName) The SmartClient class name used to lookup the corresponding SmartGWT class, which is then returned.
-
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
-
getSmartGWTClassFQN
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
This method is a convenience for calling @{link #getSmartGWTClass}.getName();- Parameters:
smartClientClassName
-- Returns:
- SmartGWT class fully qualified name or null
-