|
|||||||||
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
com.extjs.gxt.ui.client.data.BaseTreeModel
public class BaseTreeModel
Default implementation of the TreeModel
interface.
Field Summary | |
---|---|
protected java.util.List<ModelData> |
children
The model's children. |
protected TreeModel |
parent
The model's parent. |
Fields inherited from class com.extjs.gxt.ui.client.data.BaseModel |
---|
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 | |
---|---|
BaseTreeModel()
Creates a new model instance. |
|
BaseTreeModel(java.util.Map<java.lang.String,java.lang.Object> properties)
Creates a new model instance with the specified properties. |
|
BaseTreeModel(TreeModel parent)
Creates a new model instance. |
Method Summary | |
---|---|
void |
add(ModelData child)
Adds a child to the model and fires an ChangeEventSource.Add event. |
ModelData |
getChild(int index)
Returns the child at the given index or null if the index is
out of range. |
int |
getChildCount()
Returns the number of children. |
java.util.List<ModelData> |
getChildren()
Returns the model's children. |
TreeModel |
getParent()
Returns the model's parent or null if no parent. |
int |
indexOf(ModelData child)
Returns the index of the child. |
void |
insert(ModelData child,
int index)
Inserts a child to the model and fires an ChangeEventSource.Add
event. |
boolean |
isLeaf()
Returns true if the model is a leaf and has children. |
void |
notify(ChangeEvent evt)
Notifies listeners of the given change event. |
void |
remove(int index)
Removes the child at the given index. |
void |
remove(ModelData child)
Removes the child from the model and fires a ChangeEventSource.Remove event. |
void |
removeAll()
Removes all the children. |
void |
setChildren(java.util.List<ModelData> children)
Sets the model's children. |
void |
setParent(TreeModel parent)
Sets the model's parent. |
Methods inherited from class com.extjs.gxt.ui.client.data.BaseModel |
---|
addChangeListener, addChangeListener, fireEvent, fireEvent, isSilent, notifyPropertyChanged, remove, removeChangeListener, removeChangeListeners, set, setSilent |
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, remove, set |
Methods inherited from interface com.extjs.gxt.ui.client.data.ChangeEventSource |
---|
addChangeListener, removeChangeListener, removeChangeListeners, setSilent |
Field Detail |
---|
protected TreeModel parent
protected java.util.List<ModelData> children
Constructor Detail |
---|
public BaseTreeModel()
public BaseTreeModel(java.util.Map<java.lang.String,java.lang.Object> properties)
properties
- the initial propertiespublic BaseTreeModel(TreeModel parent)
parent
- the parentMethod Detail |
---|
public void add(ModelData child)
ChangeEventSource.Add
event.
add
in interface TreeModel
child
- the child to be addedpublic ModelData getChild(int index)
null
if the index is
out of range.
getChild
in interface TreeModel
index
- the index to be retrieved
public int getChildCount()
getChildCount
in interface TreeModel
public java.util.List<ModelData> getChildren()
getChildren
in interface TreeModel
public TreeModel getParent()
null
if no parent.
getParent
in interface TreeModel
public int indexOf(ModelData child)
TreeModel
indexOf
in interface TreeModel
child
- the child
public void insert(ModelData child, int index)
ChangeEventSource.Add
event.
insert
in interface TreeModel
child
- the child to be insertedindex
- the location to insert the childpublic boolean isLeaf()
TreeModel
isLeaf
in interface TreeModel
public void notify(ChangeEvent evt)
ChangeEventSource
notify
in interface ChangeEventSource
notify
in class BaseModel
evt
- the change eventpublic void remove(int index)
index
- the child indexpublic void remove(ModelData child)
ChangeEventSource.Remove
event.
remove
in interface TreeModel
child
- the child to be removedpublic void removeAll()
TreeModel
removeAll
in interface TreeModel
public void setChildren(java.util.List<ModelData> children)
children
- the children to be setpublic void setParent(TreeModel parent)
TreeModel
setParent
in interface TreeModel
parent
- the new parent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |