public abstract class BaseClass
extends java.lang.Object
implements com.google.gwt.event.shared.HasHandlers
Modifier and Type | Field and Description |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
config |
protected boolean |
configOnly |
protected boolean |
factoryCreated |
protected java.util.Map<java.lang.String,java.lang.Object> |
factoryProperties |
protected java.lang.String |
id |
protected java.lang.String |
scClassName |
Modifier | Constructor and Description |
---|---|
|
BaseClass() |
protected |
BaseClass(com.google.gwt.core.client.JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
void |
addDynamicProperty(java.lang.String propertyName,
AdvancedCriteria criteria)
Sets up the value of
propertyName to be dynamically derived from the ruleScope , by either a simple DataPath
into the ruleScope, an AdvancedCriteria built against DataPaths , or via a textual or numeric formula using the ruleScope as available
formula inputs. |
void |
addDynamicProperty(java.lang.String propertyName,
java.lang.String source)
Sets up the value of
propertyName to be dynamically derived from the ruleScope , by either a simple DataPath
into the ruleScope, an AdvancedCriteria built against DataPaths , or via a textual or numeric formula using the ruleScope as available
formula inputs. |
void |
addDynamicProperty(java.lang.String propertyName,
UserFormula formula)
Sets up the value of
propertyName to be dynamically derived from the ruleScope , by either a simple DataPath
into the ruleScope, an AdvancedCriteria built against DataPaths , or via a textual or numeric formula using the ruleScope as available
formula inputs. |
void |
addDynamicProperty(java.lang.String propertyName,
UserSummary summary)
Sets up the value of
propertyName to be dynamically derived from the ruleScope , by either a simple DataPath
into the ruleScope, an AdvancedCriteria built against DataPaths , or via a textual or numeric formula using the ruleScope as available
formula inputs. |
void |
applyFactoryProperties() |
static <T extends BaseClass> |
asSGWTComponent(com.google.gwt.core.client.JavaScriptObject jsObj)
Returns the existing SGWT component, or creates and returns one if none exist,
associated with the supplied
JavaScriptObject . |
void |
clearDynamicProperty(java.lang.String propertyName)
Clears a dynamic property previously established via
addDynamicProperty() . |
protected abstract com.google.gwt.core.client.JavaScriptObject |
create() |
protected com.google.gwt.core.client.JavaScriptObject |
createJsObj() |
void |
destroy()
Destroy this object.
|
protected <H extends com.google.gwt.event.shared.EventHandler> |
doAddHandler(H handler,
com.google.gwt.event.shared.GwtEvent.Type<H> type) |
protected void |
doInit() |
protected void |
error(java.lang.String message) |
protected void |
error(java.lang.String attribute,
java.lang.String value,
boolean allowPostCreate) |
protected void |
errorIfNotCreated(java.lang.String property) |
void |
fireEvent(com.google.gwt.event.shared.GwtEvent<?> event) |
java.lang.String |
getAttribute(java.lang.String attribute) |
java.lang.Boolean |
getAttributeAsBoolean(java.lang.String property) |
java.util.Date |
getAttributeAsDate(java.lang.String property) |
java.lang.Double |
getAttributeAsDouble(java.lang.String property) |
com.google.gwt.dom.client.Element |
getAttributeAsElement(java.lang.String property) |
java.lang.Float |
getAttributeAsFloat(java.lang.String property) |
java.lang.Integer |
getAttributeAsInt(java.lang.String property) |
com.google.gwt.core.client.JavaScriptObject |
getAttributeAsJavaScriptObject(java.lang.String property) |
java.util.Map |
getAttributeAsMap(java.lang.String property) |
java.lang.String |
getAttributeAsString(java.lang.String property) |
protected java.lang.String[] |
getAttributeAsStringArray(java.lang.String property) |
java.lang.String |
getClassName()
Returns the javascript class name.
|
com.google.gwt.core.client.JavaScriptObject |
getConfig() |
int |
getHandlerCount(com.google.gwt.event.shared.GwtEvent.Type<?> type) |
java.lang.String |
getID()
Return the ID
|
com.google.gwt.core.client.JavaScriptObject |
getJsObj() |
com.google.gwt.core.client.JavaScriptObject |
getOrCreateJsObj() |
static BaseClass |
getRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.String |
getRuleScope()
ID of the component that manages "rule context"
for which this class participates. |
java.lang.String |
getScClassName()
Get the name of the underlying SmartClient class
|
protected BaseClass |
getTestInstance() |
static boolean |
hasAutoAssignedID(com.google.gwt.core.client.JavaScriptObject jsObj) |
boolean |
hasDynamicProperty(java.lang.String propertyName)
Returns true if the property is dynamic.
|
protected void |
internalSetID(com.google.gwt.core.client.JavaScriptObject jsObj) |
protected void |
internalSetID(java.lang.String id,
boolean autoAssigned) |
boolean |
isConfigOnly() |
boolean |
isCreated() |
boolean |
isFactoryCreated() |
protected void |
onBind() |
protected void |
onInit() |
protected void |
registerID(java.lang.String id,
boolean skipUniqueJSIdentifierCheck) |
BaseClass |
setAttribute(java.lang.String attribute,
BaseClass[] value,
boolean allowPostCreate) |
protected BaseClass |
setAttribute(java.lang.String attribute,
boolean value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
java.lang.Boolean value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
DataClass[] value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
DataClass value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
java.util.Date value,
boolean allowPostCreate) |
protected BaseClass |
setAttribute(java.lang.String attribute,
double[] value,
boolean allowPostCreate) |
protected BaseClass |
setAttribute(java.lang.String attribute,
java.lang.Double[] value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
double value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
com.google.gwt.dom.client.Element value,
boolean allowPostCreate) |
protected BaseClass |
setAttribute(java.lang.String attribute,
float[] value,
boolean allowPostCreate) |
protected BaseClass |
setAttribute(java.lang.String attribute,
java.lang.Float[] value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
int[] value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
int value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
java.lang.Integer[] value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
com.google.gwt.core.client.JavaScriptObject value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
java.util.Map value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
java.lang.String[] value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
java.lang.String value,
boolean allowPostCreate) |
BaseClass |
setAttribute(java.lang.String attribute,
ValueEnum[] value,
boolean allowPostCreate) |
void |
setConfig(com.google.gwt.core.client.JavaScriptObject config) |
void |
setConfigOnly(boolean configOnly) |
void |
setFactoryCreated(boolean createdByBeanFactory) |
BaseClass |
setID(java.lang.String id) |
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
void |
setProperty(java.lang.String property,
boolean value) |
void |
setProperty(java.lang.String property,
double value) |
void |
setProperty(java.lang.String property,
com.google.gwt.core.client.JavaScriptObject value) |
void |
setProperty(java.lang.String property,
java.lang.String value) |
BaseClass |
setRuleScope(java.lang.String ruleScope)
ID of the component that manages "rule context"
for which this class participates. |
void |
setScClassName(java.lang.String scClassName)
Set the name of the underlying SmartClient class.
|
protected java.util.Map<java.lang.String,java.lang.Object> factoryProperties
protected boolean factoryCreated
protected java.lang.String id
protected com.google.gwt.core.client.JavaScriptObject config
protected java.lang.String scClassName
protected boolean configOnly
public BaseClass()
protected BaseClass(com.google.gwt.core.client.JavaScriptObject jsObj)
public void applyFactoryProperties()
public void setFactoryCreated(boolean createdByBeanFactory)
public boolean isFactoryCreated()
protected BaseClass getTestInstance()
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
public java.lang.String getID()
protected void registerID(java.lang.String id, boolean skipUniqueJSIdentifierCheck)
protected void internalSetID(com.google.gwt.core.client.JavaScriptObject jsObj)
protected void internalSetID(java.lang.String id, boolean autoAssigned)
public BaseClass setID(java.lang.String id)
public java.lang.String getClassName()
public java.lang.String getScClassName()
public void setScClassName(java.lang.String scClassName)
scClassName
- the SmartClient classpublic com.google.gwt.core.client.JavaScriptObject getConfig()
public void setConfig(com.google.gwt.core.client.JavaScriptObject config)
public boolean isCreated()
public com.google.gwt.core.client.JavaScriptObject getJsObj()
protected com.google.gwt.core.client.JavaScriptObject createJsObj()
public com.google.gwt.core.client.JavaScriptObject getOrCreateJsObj()
public static BaseClass getRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public static boolean hasAutoAssignedID(com.google.gwt.core.client.JavaScriptObject jsObj)
public static <T extends BaseClass> T asSGWTComponent(com.google.gwt.core.client.JavaScriptObject jsObj)
JavaScriptObject
. 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 the JavaScriptObject
.jsObj
- SmartClient component whose wrapper is wantedpublic void destroy()
protected void error(java.lang.String attribute, java.lang.String value, boolean allowPostCreate) throws java.lang.IllegalStateException
java.lang.IllegalStateException
protected void errorIfNotCreated(java.lang.String property) throws java.lang.IllegalStateException
java.lang.IllegalStateException
protected void error(java.lang.String message) throws java.lang.IllegalStateException
java.lang.IllegalStateException
protected abstract com.google.gwt.core.client.JavaScriptObject create()
protected final void doInit()
protected void onInit()
protected void onBind()
public void setConfigOnly(boolean configOnly)
public boolean isConfigOnly()
public java.lang.String getAttribute(java.lang.String attribute)
public java.lang.String getAttributeAsString(java.lang.String property)
public java.util.Date getAttributeAsDate(java.lang.String property)
public java.lang.Integer getAttributeAsInt(java.lang.String property)
public java.lang.Double getAttributeAsDouble(java.lang.String property)
public com.google.gwt.dom.client.Element getAttributeAsElement(java.lang.String property)
public com.google.gwt.core.client.JavaScriptObject getAttributeAsJavaScriptObject(java.lang.String property)
public java.lang.Float getAttributeAsFloat(java.lang.String property)
public java.lang.Boolean getAttributeAsBoolean(java.lang.String property)
protected java.lang.String[] getAttributeAsStringArray(java.lang.String property)
public java.util.Map getAttributeAsMap(java.lang.String property)
public BaseClass setAttribute(java.lang.String attribute, java.lang.String value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, java.lang.Boolean value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, java.util.Map value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, int[] value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, java.lang.Integer[] value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, BaseClass[] value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, DataClass[] value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, double value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, int value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, java.util.Date value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, ValueEnum[] value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, DataClass value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, com.google.gwt.core.client.JavaScriptObject value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, java.lang.String[] value, boolean allowPostCreate)
protected BaseClass setAttribute(java.lang.String attribute, float[] value, boolean allowPostCreate)
protected BaseClass setAttribute(java.lang.String attribute, java.lang.Float[] value, boolean allowPostCreate)
protected BaseClass setAttribute(java.lang.String attribute, double[] value, boolean allowPostCreate)
protected BaseClass setAttribute(java.lang.String attribute, java.lang.Double[] value, boolean allowPostCreate)
protected BaseClass setAttribute(java.lang.String attribute, boolean value, boolean allowPostCreate)
public BaseClass setAttribute(java.lang.String attribute, com.google.gwt.dom.client.Element value, boolean allowPostCreate)
public void setProperty(java.lang.String property, java.lang.String value)
public void setProperty(java.lang.String property, boolean value)
public void setProperty(java.lang.String property, double value)
public void setProperty(java.lang.String property, com.google.gwt.core.client.JavaScriptObject value)
public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
fireEvent
in interface com.google.gwt.event.shared.HasHandlers
protected final <H extends com.google.gwt.event.shared.EventHandler> com.google.gwt.event.shared.HandlerRegistration doAddHandler(H handler, com.google.gwt.event.shared.GwtEvent.Type<H> type)
public int getHandlerCount(com.google.gwt.event.shared.GwtEvent.Type<?> type)
public BaseClass setRuleScope(java.lang.String ruleScope) throws java.lang.IllegalStateException
ID
of the component that manages "rule context"
for which this class participates. A non-Canvas class can only use the ruleScope
for supporting dynamic properties
. Unlike Canvas.setRuleScope
ruleScope
on a standalone class must be explicitly specified.ruleScope
- New ruleScope value. Default value is nullBaseClass
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getRuleScope()
ID
of the component that manages "rule context"
for which this class participates. A non-Canvas class can only use the ruleScope
for supporting dynamic properties
. Unlike Canvas.setRuleScope
ruleScope
on a standalone class must be explicitly specified.public void addDynamicProperty(java.lang.String propertyName, java.lang.String source)
propertyName
to be dynamically derived from the ruleScope
, by either a simple DataPath
into the ruleScope, an AdvancedCriteria
built against DataPaths
, 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 a UserSummary
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 calling DataSource.convertCriteria()
.
propertyName
- name of a settable property on this instance.
See Identifier
source
- a DataPath
Canvas.getDataPath()
,
com.smartgwt.client.widgets.Class#getDynamicProperties
,
DataPath
public void addDynamicProperty(java.lang.String propertyName, UserFormula formula)
propertyName
to be dynamically derived from the ruleScope
, by either a simple DataPath
into the ruleScope, an AdvancedCriteria
built against DataPaths
, 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 a UserSummary
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 calling DataSource.convertCriteria()
.
propertyName
- name of a settable property on this instance.
See Identifier
formula
- a UserForula
Canvas.getDataPath()
,
com.smartgwt.client.widgets.Class#getDynamicProperties
,
DataPath
public void addDynamicProperty(java.lang.String propertyName, UserSummary summary)
propertyName
to be dynamically derived from the ruleScope
, by either a simple DataPath
into the ruleScope, an AdvancedCriteria
built against DataPaths
, 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 a UserSummary
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 calling DataSource.convertCriteria()
.
propertyName
- name of a settable property on this instance.
See Identifier
summary
- a UserSummary
Canvas.getDataPath()
,
com.smartgwt.client.widgets.Class#getDynamicProperties
,
DataPath
public void addDynamicProperty(java.lang.String propertyName, AdvancedCriteria criteria)
propertyName
to be dynamically derived from the ruleScope
, by either a simple DataPath
into the ruleScope, an AdvancedCriteria
built against DataPaths
, 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 a UserSummary
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 calling DataSource.convertCriteria()
.
propertyName
- name of a settable property on this instance.
See Identifier
criteria
- an AdvancedCriteria
Canvas.getDataPath()
,
com.smartgwt.client.widgets.Class#getDynamicProperties
,
DataPath
public void clearDynamicProperty(java.lang.String propertyName)
addDynamicProperty()
.
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.
propertyName
- name of the dynamic property to clearpublic boolean hasDynamicProperty(java.lang.String propertyName)
propertyName
- name of the dynamic property to check