|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.core.BaseClass
com.smartgwt.client.data.SimpleType
public class SimpleType
An atomic type such as a string or number, that is generally stored, displayed and manipulated as a single value.
SimpleTypes can be created at any time, and subsequently referred to as a
type
in DataSource
and
DataBoundComponent
. This allows you to define
validators
, com.smartgwt.client.data.SimpleType#normalDisplayFormatter
and editorType
behaviors for a type to be reused across all
DataBoundComponent
.
Note that the term "simpleType" is used in the same sense as in
http://www.w3.org/TR/xmlschema-0/, and
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
will create new SimpleType definitions.
An ${isc.DocUtils.linkForExampleId('customSimpleType', 'example')} is here.
Field Summary |
---|
Fields inherited from class com.smartgwt.client.core.BaseClass |
---|
config, id |
Constructor Summary | |
---|---|
SimpleType()
|
|
SimpleType(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
com.google.gwt.core.client.JavaScriptObject |
create()
|
java.lang.String |
getInheritsFrom()
Name of another SimpleType from which this type should inherit. |
java.lang.String |
getName()
Name of the type, used to refer to the type from name . |
static SimpleType |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
static SimpleType |
getType(java.lang.String typeName)
Retrieve a simpleType definition by type name |
void |
setEditorType(FormItem editorType)
Classname of the FormItem that should be the default for editing values of this type (eg "SelectItem"). |
void |
setInheritsFrom(java.lang.String inheritsFrom)
Name of another SimpleType from which this type should inherit. |
void |
setName(java.lang.String name)
Name of the type, used to refer to the type from name . |
void |
setValidators(Validator... validators)
Validators to apply to value of this type. |
void |
setValidOperators(OperatorId... operators)
Set of search operators valid for this type. |
void |
setValueMap(java.util.Map valueMap)
List of legal values for this type, like valueMap . |
void |
setValueMap(java.lang.String... valueMap)
List of legal values for this type, like valueMap . |
Methods inherited from class com.smartgwt.client.core.BaseClass |
---|
destroy, doAddHandler, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getConfig, getHandlerCount, getID, getJsObj, getOrCreateJsObj, getRef, isCreated, onInit, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setID, setProperty, setProperty, setProperty, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleType()
public SimpleType(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public static SimpleType getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public com.google.gwt.core.client.JavaScriptObject create()
create
in class BaseClass
public void setName(java.lang.String name) throws java.lang.IllegalStateException
name
.
name
- name Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getName()
name
.
public void setInheritsFrom(java.lang.String inheritsFrom) throws java.lang.IllegalStateException
Validators, if any, will be combined. All other SimpleType properties default to the inherited type's value.
inheritsFrom
- inheritsFrom Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getInheritsFrom()
Validators, if any, will be combined. All other SimpleType properties default to the inherited type's value.
public static SimpleType getType(java.lang.String typeName)
typeName
- the name
of the simpleType to return
public void setValidators(Validator... validators) throws java.lang.IllegalStateException
validators
- validators Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic void setValueMap(java.lang.String... valueMap) throws java.lang.IllegalStateException
valueMap
.
valueMap
- valueMap Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic void setValueMap(java.util.Map valueMap) throws java.lang.IllegalStateException
valueMap
.
valueMap
- valueMap Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic void setEditorType(FormItem editorType) throws java.lang.IllegalStateException
You
can create a simple custom FormItem by adding default icons
that launch custom value picking dialogs (an example is in the QuickStart Guide, Chapter 9,
Extending SmartGWT). By setting simpleType.editorType to the name of your custom FormItem, forms will
automatically use the custom FormItem, as will grids performing canEdit
.
editorType
- editorType Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic void setValidOperators(OperatorId... operators) throws java.lang.IllegalStateException
If not specified, the inheritsFrom
type's operators will be used, finally
defaulting to the default operators for the basic types (eg integer).
operators
- validOperators Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been created
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |