Class BaseClass
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
AceAnchor
,AceCompleter
,AceDocument
,AceEditSession
,AceMarker
,AceRange
,AceRenderer
,AceUndoManager
,AIEngine
,CancellationController
,CellSelection
,DataSource
,EditContext
,EditProxy
,EventStream
,HiddenPalette
,JSONEncoder
,NodeLocator
,Process
,ProcessElement
,Project
,RecordList
,RemoteWindow
,SchemaSet
,SimpleType
,SyntaxHiliter
,TextSettings
,ValuesManager
,WebService
-
Field Summary
Modifier and TypeFieldDescriptionprotected JavaScriptObject
protected boolean
protected boolean
protected String
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDynamicProperty
(String propertyName, AdvancedCriteria criteria) Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built againstDataPaths
, or via a textual or numeric formula using the ruleScope as available formula inputs.void
addDynamicProperty
(String propertyName, UserFormula formula) Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built againstDataPaths
, or via a textual or numeric formula using the ruleScope as available formula inputs.void
addDynamicProperty
(String propertyName, UserSummary summary) Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built againstDataPaths
, or via a textual or numeric formula using the ruleScope as available formula inputs.void
addDynamicProperty
(String propertyName, String source) Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built againstDataPaths
, or via a textual or numeric formula using the ruleScope as available formula inputs.void
static <T extends BaseClass>
TasSGWTComponent
(JavaScriptObject jsObj) Returns the existing SGWT component, or creates and returns one if none exist, associated with the suppliedJavaScriptObject
.void
clearDynamicProperty
(String propertyName) Clears a dynamic property previously established viaaddDynamicProperty()
.protected abstract JavaScriptObject
create()
protected JavaScriptObject
void
destroy()
Destroy this object.protected final <H extends EventHandler>
HandlerRegistrationdoAddHandler
(H handler, GwtEvent.Type<H> type) protected final void
doInit()
protected void
protected void
protected void
errorIfNotCreated
(String property) void
getAttribute
(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.int
getHandlerCount
(GwtEvent.Type<?> type) getID()
Return the IDgetJsObj()
static BaseClass
getRef
(JavaScriptObject jsObj) ID
of the component that manages "rule context" for which this class participates.Get the name of the underlying SmartClient classprotected BaseClass
static boolean
boolean
hasDynamicProperty
(String propertyName) Returns true if the property is dynamic.protected void
internalSetID
(JavaScriptObject jsObj) protected void
internalSetID
(String id, boolean autoAssigned) boolean
boolean
boolean
protected void
onBind()
protected void
onInit()
protected void
registerID
(String id, boolean skipUniqueJSIdentifierCheck) protected BaseClass
setAttribute
(String attribute, boolean value, boolean allowPostCreate) protected BaseClass
setAttribute
(String attribute, double[] value, boolean allowPostCreate) setAttribute
(String attribute, double value, boolean allowPostCreate) protected BaseClass
setAttribute
(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 BaseClass
setAttribute
(String attribute, Double[] value, boolean allowPostCreate) protected BaseClass
setAttribute
(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) void
setConfig
(JavaScriptObject config) void
setConfigOnly
(boolean configOnly) void
setFactoryCreated
(boolean createdByBeanFactory) void
void
setProperty
(String property, boolean value) void
setProperty
(String property, double value) void
setProperty
(String property, JavaScriptObject value) void
setProperty
(String property, String value) setRuleScope
(String ruleScope) ID
of the component that manages "rule context" for which this class participates.void
setScClassName
(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
ID
of the component that manages "rule context" for which this class participates. A non-Canvas class can only use the ruleScope for supportingdynamic properties
. UnlikeCanvas.setRuleScope
ruleScope
on a standalone class must be explicitly specified.- Parameters:
ruleScope
- New ruleScope value. Default value is null- Returns:
BaseClass
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getRuleScope
ID
of the component that manages "rule context" for which this class participates. A non-Canvas class can only use the ruleScope for supportingdynamic properties
. UnlikeCanvas.setRuleScope
ruleScope
on a standalone class must be explicitly specified.- Returns:
- Current ruleScope value. Default value is null
-
addDynamicProperty
Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built 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
AdvancedCriteria
will always evaluate to boolean true or false, and aUserSummary
to 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
AdvancedCriteria
by callingDataSource.convertCriteria()
.- Parameters:
propertyName
- name of a settable property on this instance. SeeIdentifier
source
- aDataPath
- See Also:
-
Canvas.getDataPath()
com.smartgwt.client.widgets.Class#getDynamicProperties
DataPath
-
addDynamicProperty
Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built 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
AdvancedCriteria
will always evaluate to boolean true or false, and aUserSummary
to 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
AdvancedCriteria
by callingDataSource.convertCriteria()
.- Parameters:
propertyName
- name of a settable property on this instance. SeeIdentifier
formula
- aUserForula
- See Also:
-
Canvas.getDataPath()
com.smartgwt.client.widgets.Class#getDynamicProperties
DataPath
-
addDynamicProperty
Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built 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
AdvancedCriteria
will always evaluate to boolean true or false, and aUserSummary
to 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
AdvancedCriteria
by callingDataSource.convertCriteria()
.- Parameters:
propertyName
- name of a settable property on this instance. SeeIdentifier
summary
- aUserSummary
- See Also:
-
Canvas.getDataPath()
com.smartgwt.client.widgets.Class#getDynamicProperties
DataPath
-
addDynamicProperty
Sets up the value ofpropertyName
to be dynamically derived from theruleScope
, by either a simpleDataPath
into the ruleScope, anAdvancedCriteria
built 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
AdvancedCriteria
will always evaluate to boolean true or false, and aUserSummary
to 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
AdvancedCriteria
by callingDataSource.convertCriteria()
.- Parameters:
propertyName
- name of a settable property on this instance. SeeIdentifier
criteria
- anAdvancedCriteria
- See Also:
-
Canvas.getDataPath()
com.smartgwt.client.widgets.Class#getDynamicProperties
DataPath
-
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
-