|
||||||||||
| 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.sencha.gxt.widget.core.client.Component
com.sencha.gxt.widget.core.client.tree.Tree<M,C>
M - the model typeC - the cell data typepublic class Tree<M,C>
A hierarchical tree widget bound directly to a @link TreeStore.
Tree 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.
ModelKeyProvider must be specified with the
TreeStore this tree is bound to. Save and restore works with
both local, and asynchronous loading of children.
| Nested Class Summary | |
|---|---|
static class |
Tree.CheckCascade
Check cascade enum. |
static class |
Tree.CheckNodes
Check nodes enum. |
static class |
Tree.CheckState
|
static class |
Tree.Joint
Joint enum. |
static interface |
Tree.TreeAppearance
|
static class |
Tree.TreeNode<M>
Maintains the internal state of nodes contained in the tree. |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Tree(TreeStore<M> store,
ValueProvider<? super M,C> valueProvider)
Creates a new tree panel. |
|
Tree(TreeStore<M> store,
ValueProvider<? super M,C> valueProvider,
Tree.TreeAppearance appearance)
|
|
| Method Summary | |
|---|---|
HandlerRegistration |
addBeforeCheckChangeHandler(BeforeCheckChangeEvent.BeforeCheckChangeHandler<M> handler)
Adds a BeforeCheckChangeEvent.BeforeCheckChangeHandler handler for BeforeCheckChangeEvent events. |
HandlerRegistration |
addBeforeCollapseHandler(BeforeCollapseItemEvent.BeforeCollapseItemHandler<M> handler)
Adds a BeforeCollapseItemEvent.BeforeCollapseItemHandler handler for BeforeCollapseItemEvent
events. |
HandlerRegistration |
addBeforeExpandHandler(BeforeExpandItemEvent.BeforeExpandItemHandler<M> handler)
Adds a BeforeExpandItemEvent.BeforeExpandItemHandler handler for BeforeExpandItemEvent
events. |
HandlerRegistration |
addCheckChangedHandler(CheckChangedEvent.CheckChangedHandler<M> handler)
Adds a CheckChangedEvent.CheckChangedHandler handler for CheckChangedEvent
events. |
HandlerRegistration |
addCheckChangeHandler(CheckChangeEvent.CheckChangeHandler<M> handler)
Adds a CheckChangeEvent.CheckChangeHandler handler for CheckChangeEvent
events. |
HandlerRegistration |
addCollapseHandler(CollapseItemEvent.CollapseItemHandler<M> handler)
Adds a CollapseItemEvent.CollapseItemHandler handler for CollapseItemEvent
events. |
HandlerRegistration |
addExpandHandler(ExpandItemEvent.ExpandItemHandler<M> handler)
Adds a ExpandItemEvent.ExpandItemHandler handler for ExpandItemEvent events. |
void |
collapseAll()
Collapses all nodes. |
void |
expandAll()
Expands all nodes. |
Tree.TreeNode<M> |
findNode(Element target)
Returns the tree node for the given target. |
Tree.TreeNode<M> |
findNode(M model)
Returns the tree node for the given model. |
Tree.TreeAppearance |
getAppearance()
Returns the tree appearance. |
Cell<C> |
getCell()
Return the tree's cell. |
Tree.CheckState |
getChecked(M model)
Returns the models checked state. |
List<M> |
getCheckedSelection()
Returns the current checked selection. |
Tree.CheckNodes |
getCheckNodes()
Returns the child nodes value which determines what node types have a check box. |
Tree.CheckCascade |
getCheckStyle()
The check cascade style value which determines if check box changes cascade to parent and children. |
IconProvider<M> |
getIconProvider()
Returns the model icon provider. |
TreeSelectionModel<M> |
getSelectionModel()
Returns the tree's selection model. |
TreeStore<M> |
getStore()
Returns the tree's store. |
TreeStyle |
getStyle()
Returns the tree style. |
TreeView<M> |
getView()
Returns the tree's view. |
boolean |
isAutoExpand()
Returns true if auto expand is enabled. |
boolean |
isAutoLoad()
Returns true if auto load is enabled. |
boolean |
isAutoSelect()
Returns true if select on load is enabled. |
boolean |
isBufferedRender()
Returns true if buffered rendering 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 |
onBrowserEvent(Event event)
|
void |
refresh(M model)
|
void |
scrollIntoView(M model)
Scrolls the tree to ensure the given model is visible. |
void |
setAutoExpand(boolean autoExpand)
If set to true, all non leaf nodes will be expanded automatically (defaults to false). |
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 |
setBufferedRender(boolean bufferRender)
True to only render tree nodes that are in view (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 |
setCell(Cell<C> cell)
Sets the tree's cell. |
void |
setCheckable(boolean checkable)
Sets whether check boxes are used in the tree (defaults to false). |
void |
setChecked(M item,
Tree.CheckState checked)
Sets the check state of the item. |
void |
setCheckedSelection(List<M> selection)
Sets the current checked selection. |
void |
setCheckNodes(Tree.CheckNodes checkNodes)
Sets which tree items will display a check box (defaults to BOTH). |
void |
setCheckStyle(Tree.CheckCascade checkStyle)
Sets the cascading behavior for check tree (defaults to PARENTS). |
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(IconProvider<M> iconProvider)
Sets the tree's model icon provider which provides the icon style for each model. |
void |
setLeaf(M model,
boolean leaf)
Sets the item's leaf state. |
void |
setLoader(TreeLoader<M> loader)
Sets the tree loader. |
void |
setSelectionModel(TreeSelectionModel<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(TreeView<M> view)
Sets the tree's view. |
void |
toggle(M model)
Toggles the model's expand state. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
@UiConstructor
public Tree(TreeStore<M> store,
ValueProvider<? super M,C> valueProvider)
store - the tree store
public Tree(TreeStore<M> store,
ValueProvider<? super M,C> valueProvider,
Tree.TreeAppearance appearance)
| Method Detail |
|---|
public HandlerRegistration addBeforeCheckChangeHandler(BeforeCheckChangeEvent.BeforeCheckChangeHandler<M> handler)
BeforeCheckChangeEvent.HasBeforeCheckChangeHandlersBeforeCheckChangeEvent.BeforeCheckChangeHandler handler for BeforeCheckChangeEvent events.
addBeforeCheckChangeHandler in interface BeforeCheckChangeEvent.HasBeforeCheckChangeHandlers<M>handler - the handler
public HandlerRegistration addBeforeCollapseHandler(BeforeCollapseItemEvent.BeforeCollapseItemHandler<M> handler)
BeforeCollapseItemEvent.HasBeforeCollapseItemHandlersBeforeCollapseItemEvent.BeforeCollapseItemHandler handler for BeforeCollapseItemEvent
events.
addBeforeCollapseHandler in interface BeforeCollapseItemEvent.HasBeforeCollapseItemHandlers<M>handler - the handler
public HandlerRegistration addBeforeExpandHandler(BeforeExpandItemEvent.BeforeExpandItemHandler<M> handler)
BeforeExpandItemEvent.HasBeforeExpandItemHandlersBeforeExpandItemEvent.BeforeExpandItemHandler handler for BeforeExpandItemEvent
events.
addBeforeExpandHandler in interface BeforeExpandItemEvent.HasBeforeExpandItemHandlers<M>handler - the handler
public HandlerRegistration addCheckChangedHandler(CheckChangedEvent.CheckChangedHandler<M> handler)
CheckChangedEvent.HasCheckChangedHandlersCheckChangedEvent.CheckChangedHandler handler for CheckChangedEvent
events.
addCheckChangedHandler in interface CheckChangedEvent.HasCheckChangedHandlers<M>handler - the handler
public HandlerRegistration addCheckChangeHandler(CheckChangeEvent.CheckChangeHandler<M> handler)
CheckChangeEvent.HasCheckChangeHandlersCheckChangeEvent.CheckChangeHandler handler for CheckChangeEvent
events.
addCheckChangeHandler in interface CheckChangeEvent.HasCheckChangeHandlers<M>handler - the handler
public HandlerRegistration addCollapseHandler(CollapseItemEvent.CollapseItemHandler<M> handler)
CollapseItemEvent.HasCollapseItemHandlersCollapseItemEvent.CollapseItemHandler handler for CollapseItemEvent
events.
addCollapseHandler in interface CollapseItemEvent.HasCollapseItemHandlers<M>handler - the handler
public HandlerRegistration addExpandHandler(ExpandItemEvent.ExpandItemHandler<M> handler)
ExpandItemEvent.HasExpandItemHandlersExpandItemEvent.ExpandItemHandler handler for ExpandItemEvent events.
addExpandHandler in interface ExpandItemEvent.HasExpandItemHandlers<M>handler - the handler
public void collapseAll()
public void expandAll()
public Tree.TreeNode<M> findNode(Element target)
target - the target element
public Tree.TreeNode<M> findNode(M model)
model - the model
public Tree.TreeAppearance getAppearance()
public Cell<C> getCell()
public Tree.CheckState getChecked(M model)
model - the model
public List<M> getCheckedSelection()
setAutoLoad(boolean) to true to
fully render the tree to receive all checked items in the tree.
getCheckedSelection in interface CheckProvider<M>public Tree.CheckNodes getCheckNodes()
setCheckable(boolean).
public Tree.CheckCascade getCheckStyle()
public IconProvider<M> getIconProvider()
public TreeSelectionModel<M> getSelectionModel()
public TreeStore<M> getStore()
public TreeStyle getStyle()
public TreeView<M> getView()
public boolean isAutoExpand()
public boolean isAutoLoad()
public boolean isAutoSelect()
public boolean isBufferedRender()
public boolean isCaching()
public boolean isCheckable()
public boolean isChecked(M model)
CheckProvider
isChecked in interface CheckProvider<M>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 onBrowserEvent(Event event)
onBrowserEvent in interface EventListeneronBrowserEvent in class Componentpublic void refresh(M model)
public void scrollIntoView(M model)
model - the model to scroll into viewpublic void setAutoExpand(boolean autoExpand)
autoExpand - the auto expand state to set.public void setAutoLoad(boolean autoLoad)
autoLoad - true to auto loadpublic void setAutoSelect(boolean autoSelect)
autoSelect - true to auto selectpublic void setBufferedRender(boolean bufferRender)
bufferRender - true to buffer renderpublic void setCaching(boolean caching)
false, a load request will
be made each time a node is expanded.
caching - the caching statepublic void setCell(Cell<C> cell)
cell - the cellpublic void setCheckable(boolean checkable)
checkable - true for check boxes
public void setChecked(M item,
Tree.CheckState checked)
setAutoLoad(boolean) can be used to
render all children.
item - the itemchecked - the check statepublic void setCheckedSelection(List<M> selection)
CheckProvider
setCheckedSelection in interface CheckProvider<M>selection - the checked selectionpublic void setCheckNodes(Tree.CheckNodes checkNodes)
Valid values are:
checkNodes - the child nodes valuepublic void setCheckStyle(Tree.CheckCascade checkStyle)
setAutoLoad(boolean) can be used to
fully render the tree on render.
Valid values are:
checkStyle - the child style
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(IconProvider<M> iconProvider)
iconProvider - the icon provider
public void setLeaf(M model,
boolean leaf)
model - the modelleaf - the leaf statepublic void setLoader(TreeLoader<M> loader)
loader - the loaderpublic void setSelectionModel(TreeSelectionModel<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(TreeView<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 | |||||||||