|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.treepanel.TreePanel<M>
M - the model typepublic class TreePanel<M extends ModelData>
A hierarchical tree widget bound directly to a @link TreeStore.
TreePanel contains no child widgets, rather, the tree is
rendered based on the models contained in the tree store. Once bound, the
tree will remain in sync with the bound tree store.
setDisplayProperty(String). The
is useful when the item's text is contained within the model's data. Second,
a model string provider can be specified using
setLabelProvider(ModelStringProvider).
With state enabled, TreePanel will save and restore the expand state of the
nodes in the tree. A ModelKeyProvider must specified with the
TreeStore this tree is bound to. Save and restore works with
both local, and asynchronous loading of children.
BaseEvent.setCancelled(boolean).BaseEvent.setCancelled(boolean).BaseEvent.setCancelled(boolean).
| Nested Class Summary | |
|---|---|
static class |
TreePanel.CheckCascade
Check cascade enum. |
static class |
TreePanel.CheckNodes
Check nodes enum. |
static class |
TreePanel.Joint
Joint enum. |
class |
TreePanel.TreeNode
Maintains the internal state of nodes contained in the tree. |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
TreePanel(TreeStore<M> store)
Creates a new tree panel. |
|
| Method Summary | |
|---|---|
void |
addCheckListener(CheckChangedListener<M> listener)
Adds the check change listener. |
void |
collapseAll()
Collapses all nodes. |
void |
expandAll()
Expands all nodes. |
TreePanel.TreeNode |
findNode(com.google.gwt.user.client.Element target)
Returns the tree node for the given target. |
java.util.List<M> |
getCheckedSelection()
Returns the current checked selection. |
TreePanel.CheckNodes |
getCheckNodes()
Returns the child nodes value which determines what node types have a check box. |
TreePanel.CheckCascade |
getCheckStyle()
The check cascade style value which determines if check box changes cascade to parent and children. |
java.lang.String |
getDisplayProperty()
Returns the display property. |
ModelIconProvider<M> |
getIconProvider()
Returns the model icon provider. |
TreePanelSelectionModel<M> |
getSelectionModel()
Returns the tree's selection model. |
TreeStore<M> |
getStore()
Returns the tree's store. |
TreeStyle |
getStyle()
Returns the tree style. |
TreePanelView<M> |
getView()
Returns the tree's view. |
boolean |
isAutoLoad()
Returns true if auto load is enabled. |
boolean |
isAutoSelect()
Returns true if select on load is enabled. |
boolean |
isCaching()
Returns true when a loader is queried for it's children each time a node is expanded. |
boolean |
isCheckable()
Returns true if check boxes are enabled. |
boolean |
isChecked(M model)
Returns true if the model is checked. |
boolean |
isExpanded(M model)
Returns true if the model is expanded. |
boolean |
isExpandOnFilter()
Returns the if expand all and collapse all is enabled on filter changes. |
boolean |
isLeaf(M model)
Returns true if the model is a leaf node. |
boolean |
isTrackMouseOver()
Returns true if nodes are highlighted on mouse over. |
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
void |
recalculate()
Called when the component is in a LayoutContainer and the container's layout executes. |
void |
removeCheckListener(CheckChangedListener<M> listener)
Removes the check change listener. |
void |
scrollIntoView(M model)
Scrolls the tree to ensure the given model is visible. |
void |
setAutoLoad(boolean autoLoad)
Sets whether all children should automatically be loaded recursively (defaults to false). |
void |
setAutoSelect(boolean autoSelect)
True to select the first model after the store's data changes (defaults to false). |
void |
setCaching(boolean caching)
Sets whether the children should be cached after first being retrieved from the store (defaults to true). |
void |
setCheckable(boolean checkable)
Sets whether check boxes are used in the tree. |
void |
setChecked(M item,
boolean checked)
Sets the check state of the item. |
void |
setCheckedSelection(java.util.List<M> selection)
Sets the current checked selection. |
void |
setCheckNodes(TreePanel.CheckNodes checkNodes)
Sets which tree items will display a check box (defaults to BOTH). |
void |
setCheckStyle(TreePanel.CheckCascade checkStyle)
Sets the cascading behavior for check tree (defaults to PARENTS). |
void |
setDisplayProperty(java.lang.String displayProperty)
Sets the display property name used to the item's text. |
void |
setExpanded(M model,
boolean expand)
Sets the item's expand state. |
void |
setExpanded(M model,
boolean expand,
boolean deep)
Sets the item's expand state. |
void |
setExpandOnFilter(boolean expandOnFilter)
Sets whether the tree should expand all and collapse all when filters are applied (defaults to true). |
void |
setIconProvider(ModelIconProvider<M> iconProvider)
Sets the tree's model icon provider which provides the icon style for each model. |
void |
setLabelProvider(ModelStringProvider<M> labelProvider)
Sets the tree's model string provider for the text description of each node. |
void |
setLeaf(M model,
boolean leaf)
Sets the item's leaf state. |
void |
setSelectionModel(TreePanelSelectionModel<M> sm)
Sets the tree's selection model. |
void |
setStyle(TreeStyle style)
Sets the tree style. |
void |
setTrackMouseOver(boolean trackMouseOver)
True to highlight nodes when the mouse is over (defaults to true). |
void |
setView(TreePanelView<M> view)
Sets the tree's view. |
void |
toggle(M model)
Toggles the model's expand state. |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getParent, isAttached |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TreePanel(TreeStore<M> store)
store - the tree store| Method Detail |
|---|
public void addCheckListener(CheckChangedListener<M> listener)
CheckProvider
addCheckListener in interface CheckProvider<M extends ModelData>listener - the listener to be addedpublic void collapseAll()
public void expandAll()
public TreePanel.TreeNode findNode(com.google.gwt.user.client.Element target)
target - the target element
public java.util.List<M> getCheckedSelection()
CheckProvider
getCheckedSelection in interface CheckProvider<M extends ModelData>public TreePanel.CheckNodes getCheckNodes()
setCheckable(boolean).
public TreePanel.CheckCascade getCheckStyle()
public java.lang.String getDisplayProperty()
public ModelIconProvider<M> getIconProvider()
public TreePanelSelectionModel<M> getSelectionModel()
public TreeStore<M> getStore()
public TreeStyle getStyle()
public TreePanelView<M> getView()
public boolean isAutoLoad()
public boolean isAutoSelect()
public boolean isCaching()
public boolean isCheckable()
public boolean isChecked(M model)
CheckProvider
isChecked in interface CheckProvider<M extends ModelData>model - the model
public boolean isExpanded(M model)
model - the model
public boolean isExpandOnFilter()
public boolean isLeaf(M model)
model - the model
public boolean isTrackMouseOver()
public void onComponentEvent(ComponentEvent ce)
ComponentComponent.onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
onComponentEvent in class Componentce - the base eventpublic void recalculate()
Component
recalculate in class Componentpublic void removeCheckListener(CheckChangedListener<M> listener)
CheckProvider
removeCheckListener in interface CheckProvider<M extends ModelData>listener - the listener to be removedpublic void scrollIntoView(M model)
model - the model to scroll into viewpublic void setAutoLoad(boolean autoLoad)
autoLoad - true to auto loadpublic void setAutoSelect(boolean autoSelect)
autoSelect - true to auto selectpublic void setCaching(boolean caching)
false, a load request will
be made each time a node is expanded.
caching - the caching statepublic void setCheckable(boolean checkable)
checkable - true for check boxes
public void setChecked(M item,
boolean checked)
setAutoLoad(boolean) can be used to
render all children.
item - the itemchecked - true for checkedpublic void setCheckedSelection(java.util.List<M> selection)
CheckProvider
setCheckedSelection in interface CheckProvider<M extends ModelData>selection - the checked selectionpublic void setCheckNodes(TreePanel.CheckNodes checkNodes)
Valid values are:
checkNodes - the child nodes valuepublic void setCheckStyle(TreePanel.CheckCascade checkStyle)
setAutoLoad(boolean) can be used to
fully render the tree on render.
Valid values are:
checkStyle - the child stylepublic void setDisplayProperty(java.lang.String displayProperty)
ModelStringProvider can be specified using
setLabelProvider(ModelStringProvider).
displayProperty - the property name
public void setExpanded(M model,
boolean expand)
model - the modelexpand - true to expand
public void setExpanded(M model,
boolean expand,
boolean deep)
model - the modelexpand - true to expanddeep - true to expand all children recursivelypublic void setExpandOnFilter(boolean expandOnFilter)
expandOnFilter - true to expand and collapse on filter changespublic void setIconProvider(ModelIconProvider<M> iconProvider)
iconProvider - the icon providerpublic void setLabelProvider(ModelStringProvider<M> labelProvider)
null
will be passed.
labelProvider - the label provider
public void setLeaf(M model,
boolean leaf)
model - the modelleaf - the leaf statepublic void setSelectionModel(TreePanelSelectionModel<M> sm)
sm - the selection modelpublic void setStyle(TreeStyle style)
style - the tree stylepublic void setTrackMouseOver(boolean trackMouseOver)
trackMouseOver - true to highlight nodes on mouse overpublic void setView(TreePanelView<M> view)
view - the viewpublic void toggle(M model)
model - the model
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||