Class BaseClass
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
AceAnchor,AceCompleter,AceDocument,AceEditSession,AceMarker,AceRange,AceRenderer,AceUndoManager,AIEngine,AnswerEngineOperation,CancellationController,CellSelection,DataSource,EditContext,EditProxy,EventStream,HiddenPalette,JSONEncoder,NodeLocator,Process,ProcessElement,Project,RecordList,RemoteWindow,SchemaSet,SimpleType,SyntaxHiliter,TextSettings,ValuesManager,WebService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JavaScriptObjectprotected booleanprotected booleanprotected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDynamicProperty(String propertyName, AdvancedCriteria criteria) Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.voidaddDynamicProperty(String propertyName, UserFormula formula) Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.voidaddDynamicProperty(String propertyName, UserSummary summary) Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.voidaddDynamicProperty(String propertyName, String source) Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.voidstatic <T extends BaseClass>
TasSGWTComponent(JavaScriptObject jsObj) Returns the existing SGWT component, or creates and returns one if none exist, associated with the suppliedJavaScriptObject.voidclearDynamicProperty(String propertyName) Clears a dynamic property previously established viaaddDynamicProperty().protected abstract JavaScriptObjectcreate()protected JavaScriptObjectvoiddestroy()Destroy this object.protected final <H extends EventHandler>
HandlerRegistrationdoAddHandler(H handler, GwtEvent.Type<H> type) protected final voiddoInit()protected voidprotected voidprotected voiderrorIfNotCreated(String property) voidgetAttribute(String attribute) getAttributeAsBoolean(String property) getAttributeAsDate(String property) getAttributeAsDouble(String property) getAttributeAsElement(String property) getAttributeAsFloat(String property) getAttributeAsInt(String property) getAttributeAsJavaScriptObject(String property) getAttributeAsMap(String property) getAttributeAsString(String property) protected String[]getAttributeAsStringArray(String property) Returns the javascript class name.intgetHandlerCount(GwtEvent.Type<?> type) getID()Return the IDgetJsObj()static BaseClassgetRef(JavaScriptObject jsObj) IDof the component that manages "rule context" for which this class participates.Get the name of the underlying SmartClient classprotected BaseClassstatic booleanbooleanhasDynamicProperty(String propertyName) Returns true if the property is dynamic.protected voidinternalSetID(JavaScriptObject jsObj) protected voidinternalSetID(String id, boolean autoAssigned) booleanbooleanbooleanprotected voidonBind()protected voidonInit()protected voidregisterID(String id, boolean skipUniqueJSIdentifierCheck) protected BaseClasssetAttribute(String attribute, boolean value, boolean allowPostCreate) protected BaseClasssetAttribute(String attribute, double[] value, boolean allowPostCreate) setAttribute(String attribute, double value, boolean allowPostCreate) protected BaseClasssetAttribute(String attribute, float[] value, boolean allowPostCreate) setAttribute(String attribute, int[] value, boolean allowPostCreate) setAttribute(String attribute, int value, boolean allowPostCreate) setAttribute(String attribute, JavaScriptObject value, boolean allowPostCreate) setAttribute(String attribute, Element value, boolean allowPostCreate) setAttribute(String attribute, BaseClass[] value, boolean allowPostCreate) setAttribute(String attribute, DataClass[] value, boolean allowPostCreate) setAttribute(String attribute, DataClass value, boolean allowPostCreate) setAttribute(String attribute, ValueEnum[] value, boolean allowPostCreate) setAttribute(String attribute, Boolean value, boolean allowPostCreate) protected BaseClasssetAttribute(String attribute, Double[] value, boolean allowPostCreate) protected BaseClasssetAttribute(String attribute, Float[] value, boolean allowPostCreate) setAttribute(String attribute, Integer[] value, boolean allowPostCreate) setAttribute(String attribute, String[] value, boolean allowPostCreate) setAttribute(String attribute, String value, boolean allowPostCreate) setAttribute(String attribute, Date value, boolean allowPostCreate) setAttribute(String attribute, Map value, boolean allowPostCreate) voidsetConfig(JavaScriptObject config) voidsetConfigOnly(boolean configOnly) voidsetFactoryCreated(boolean createdByBeanFactory) voidvoidsetProperty(String property, boolean value) voidsetProperty(String property, double value) voidsetProperty(String property, JavaScriptObject value) voidsetProperty(String property, String value) setRuleScope(String ruleScope) IDof the component that manages "rule context" for which this class participates.voidsetScClassName(String scClassName) Set the name of the underlying SmartClient class.
-
Field Details
-
factoryProperties
-
factoryCreated
protected boolean factoryCreated -
id
-
config
-
scClassName
-
configOnly
protected boolean configOnly
-
-
Constructor Details
-
BaseClass
public BaseClass() -
BaseClass
-
-
Method Details
-
applyFactoryProperties
public void applyFactoryProperties() -
setFactoryCreated
public void setFactoryCreated(boolean createdByBeanFactory) -
isFactoryCreated
public boolean isFactoryCreated() -
getTestInstance
-
setJavaScriptObject
-
getID
Return the ID- Returns:
- the ID
-
registerID
-
internalSetID
-
internalSetID
-
setID
-
getClassName
Returns the javascript class name.- Returns:
- the class name
-
getScClassName
Get the name of the underlying SmartClient class- Returns:
- the SmartClient class name
-
setScClassName
Set the name of the underlying SmartClient class. This is an advanced setting.- Parameters:
scClassName- the SmartClient class
-
getConfig
-
setConfig
-
isCreated
public boolean isCreated() -
getJsObj
-
createJsObj
-
getOrCreateJsObj
-
getRef
-
hasAutoAssignedID
-
asSGWTComponent
Returns the existing SGWT component, or creates and returns one if none exist, associated with the suppliedJavaScriptObject. If the supplied object is not representable as a SGWT component descended from BaseClass, or if this method is not capable of creating the SGWT wrapper, a warning will be logged and null returned. In the latter case, you must call asSGWTComponent on a more specific class (e.g.ResultSet.asSGWTComponent), or if no such method exists, simply build the wrapper with new, supplying theJavaScriptObject.- Parameters:
jsObj- SmartClient component whose wrapper is wanted- Returns:
- wrapping SGWT component (instance of BaseClass-descended class) or null
-
destroy
public void destroy()Destroy this object. -
error
protected void error(String attribute, String value, boolean allowPostCreate) throws IllegalStateException - Throws:
IllegalStateException
-
errorIfNotCreated
- Throws:
IllegalStateException
-
error
- Throws:
IllegalStateException
-
create
-
doInit
protected final void doInit() -
onInit
protected void onInit() -
onBind
protected void onBind() -
setConfigOnly
public void setConfigOnly(boolean configOnly) -
isConfigOnly
public boolean isConfigOnly() -
getAttribute
-
getAttributeAsString
-
getAttributeAsDate
-
getAttributeAsInt
-
getAttributeAsDouble
-
getAttributeAsElement
-
getAttributeAsJavaScriptObject
-
getAttributeAsFloat
-
getAttributeAsBoolean
-
getAttributeAsStringArray
-
getAttributeAsMap
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setAttribute
-
setProperty
-
setProperty
-
setProperty
-
setProperty
-
setRuleScope
IDof the component that manages "rule context" for which this class participates. A non-Canvas class can only use the ruleScope for supportingdynamic properties. UnlikeCanvas.setRuleScoperuleScopeon a standalone class must be explicitly specified.- Parameters:
ruleScope- New ruleScope value. Default value is null- Returns:
BaseClassinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the component has been created
-
getRuleScope
IDof the component that manages "rule context" for which this class participates. A non-Canvas class can only use the ruleScope for supportingdynamic properties. UnlikeCanvas.setRuleScoperuleScopeon a standalone class must be explicitly specified.- Returns:
- Current ruleScope value. Default value is null
-
addDynamicProperty
Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.The dataPath, criteria, or formula is evaluated immediately when addDynamicProperty() is called, then re-evaluated every time the ruleScope changes. An
AdvancedCriteriawill always evaluate to boolean true or false, and aUserSummaryto a string.It is invalid usage to use
addDynamicProperty()on a property that is not runtime settable. However,addDynamicProperty()will not throw an error or log a warning if this is done.If a property is already dynamic and addDynamicProperty() is called again, the new dynamic behavior replaces the old. If a property should no longer be dynamic, call
clearDynamicProperty().Dynamic properties can also be declared together via
dynamicProperties.Note that you may convert a simple criteria to an
AdvancedCriteriaby callingDataSource.convertCriteria().- Parameters:
propertyName- name of a settable property on this instance. SeeIdentifiersource- aDataPath- See Also:
-
Canvas.getDataPath()com.smartgwt.client.widgets.Class#getDynamicPropertiesDataPath
-
addDynamicProperty
Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.The dataPath, criteria, or formula is evaluated immediately when addDynamicProperty() is called, then re-evaluated every time the ruleScope changes. An
AdvancedCriteriawill always evaluate to boolean true or false, and aUserSummaryto a string.It is invalid usage to use
addDynamicProperty()on a property that is not runtime settable. However,addDynamicProperty()will not throw an error or log a warning if this is done.If a property is already dynamic and addDynamicProperty() is called again, the new dynamic behavior replaces the old. If a property should no longer be dynamic, call
clearDynamicProperty().Dynamic properties can also be declared together via
dynamicProperties.Note that you may convert a simple criteria to an
AdvancedCriteriaby callingDataSource.convertCriteria().- Parameters:
propertyName- name of a settable property on this instance. SeeIdentifierformula- aUserForula- See Also:
-
Canvas.getDataPath()com.smartgwt.client.widgets.Class#getDynamicPropertiesDataPath
-
addDynamicProperty
Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.The dataPath, criteria, or formula is evaluated immediately when addDynamicProperty() is called, then re-evaluated every time the ruleScope changes. An
AdvancedCriteriawill always evaluate to boolean true or false, and aUserSummaryto a string.It is invalid usage to use
addDynamicProperty()on a property that is not runtime settable. However,addDynamicProperty()will not throw an error or log a warning if this is done.If a property is already dynamic and addDynamicProperty() is called again, the new dynamic behavior replaces the old. If a property should no longer be dynamic, call
clearDynamicProperty().Dynamic properties can also be declared together via
dynamicProperties.Note that you may convert a simple criteria to an
AdvancedCriteriaby callingDataSource.convertCriteria().- Parameters:
propertyName- name of a settable property on this instance. SeeIdentifiersummary- aUserSummary- See Also:
-
Canvas.getDataPath()com.smartgwt.client.widgets.Class#getDynamicPropertiesDataPath
-
addDynamicProperty
Sets up the value ofpropertyNameto be dynamically derived from theruleScope, by either a simpleDataPathinto the ruleScope, anAdvancedCriteriabuilt againstDataPaths, or via a textual or numeric formula using the ruleScope as available formula inputs.The dataPath, criteria, or formula is evaluated immediately when addDynamicProperty() is called, then re-evaluated every time the ruleScope changes. An
AdvancedCriteriawill always evaluate to boolean true or false, and aUserSummaryto a string.It is invalid usage to use
addDynamicProperty()on a property that is not runtime settable. However,addDynamicProperty()will not throw an error or log a warning if this is done.If a property is already dynamic and addDynamicProperty() is called again, the new dynamic behavior replaces the old. If a property should no longer be dynamic, call
clearDynamicProperty().Dynamic properties can also be declared together via
dynamicProperties.Note that you may convert a simple criteria to an
AdvancedCriteriaby callingDataSource.convertCriteria().- Parameters:
propertyName- name of a settable property on this instance. SeeIdentifiercriteria- anAdvancedCriteria- See Also:
-
Canvas.getDataPath()com.smartgwt.client.widgets.Class#getDynamicPropertiesDataPath
-
clearDynamicProperty
Clears a dynamic property previously established viaaddDynamicProperty().If the property is not currently dynamic, nothing will be done (and no warning logged).
The current value of the property will not be changed by this call.
- Parameters:
propertyName- name of the dynamic property to clear
-
hasDynamicProperty
Returns true if the property is dynamic.- Parameters:
propertyName- name of the dynamic property to check- Returns:
- boolean true if the property is dynamic
-