|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.data.BaseModelData
com.extjs.gxt.ui.client.data.BaseModel
public class BaseModel
Models
are generic data structures that notify listeners when
changed. The structure allows a form of 'introspection' as all property names
and values can be queried and retrieved at runtime.
All events fired by the model will bubble to all parents.
Model objects implement Serializable
and can therefore be used
with GWT RPC. A model's children are not marked transient and will be passed
in remote procedure calls.
ChangeListener
,
Serializable
,
Serialized FormField Summary | |
---|---|
protected ChangeEventSupport |
changeEventSupport
|
Fields inherited from class com.extjs.gxt.ui.client.data.BaseModelData |
---|
allowNestedValues, map |
Fields inherited from interface com.extjs.gxt.ui.client.data.ChangeEventSource |
---|
Add, Remove, Update |
Constructor Summary | |
---|---|
BaseModel()
Creates a new base model. |
|
BaseModel(java.util.Map<java.lang.String,java.lang.Object> properties)
Creates a new base model. |
Method Summary | ||
---|---|---|
void |
addChangeListener(ChangeListener... listener)
Adds a listener to receive change events. |
|
void |
addChangeListener(java.util.List<ChangeListener> listeners)
Adds the listeners to receive change events. |
|
protected void |
fireEvent(int type)
|
|
protected void |
fireEvent(int type,
Model item)
|
|
boolean |
isSilent()
Returns true if change events are disabled. |
|
void |
notify(ChangeEvent evt)
Notifies listeners of the given change event. |
|
protected void |
notifyPropertyChanged(java.lang.String name,
java.lang.Object value,
java.lang.Object oldValue)
|
|
|
remove(java.lang.String name)
Removes the named property from this model instance. |
|
void |
removeChangeListener(ChangeListener... listener)
Removes a previously added change listener. |
|
void |
removeChangeListeners()
Removes all change listeners. |
|
|
set(java.lang.String name,
X value)
Sets the property and fires an Update event. |
|
void |
setSilent(boolean silent)
Sets whether change events are fired. |
Methods inherited from class com.extjs.gxt.ui.client.data.BaseModelData |
---|
get, get, getProperties, getPropertyNames, isAllowNestedValues, setAllowNestedValues, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.extjs.gxt.ui.client.data.ModelData |
---|
get, getProperties, getPropertyNames |
Field Detail |
---|
protected transient ChangeEventSupport changeEventSupport
Constructor Detail |
---|
public BaseModel()
public BaseModel(java.util.Map<java.lang.String,java.lang.Object> properties)
properties
- the initial valuesMethod Detail |
---|
public void addChangeListener(ChangeListener... listener)
addChangeListener
in interface ChangeEventSource
listener
- the listener to be addedpublic void addChangeListener(java.util.List<ChangeListener> listeners)
listeners
- the listeners to addpublic boolean isSilent()
public void notify(ChangeEvent evt)
ChangeEventSource
notify
in interface ChangeEventSource
evt
- the change eventpublic <X> X remove(java.lang.String name)
ModelData
remove
in interface ModelData
remove
in class BaseModelData
name
- the property name
public void removeChangeListener(ChangeListener... listener)
removeChangeListener
in interface ChangeEventSource
listener
- the listener to be removedpublic void removeChangeListeners()
ChangeEventSource
removeChangeListeners
in interface ChangeEventSource
public <X> X set(java.lang.String name, X value)
BaseModelData
set
in interface ModelData
set
in class BaseModelData
name
- the property namevalue
- the property value
public void setSilent(boolean silent)
ChangeEventSource
setSilent
in interface ChangeEventSource
silent
- true to disable change event, otherwise falseprotected void fireEvent(int type)
protected void fireEvent(int type, Model item)
protected void notifyPropertyChanged(java.lang.String name, java.lang.Object value, java.lang.Object oldValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |