|
|||||||||
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.grid.Grid<M>
com.extjs.gxt.ui.client.widget.treegrid.TreeGrid<M>
M
- the model typepublic class TreeGrid<M extends ModelData>
A hierarchical tree grid bound to a TreeStore
.
TreeGridCellRenderer
can be assigned to the
ColumnConfig
in which the tree will be displayed.
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.
Nested Class Summary | |
---|---|
class |
TreeGrid.TreeNode
|
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 | |
---|---|
protected java.util.Map<M,java.lang.String> |
cache
|
protected boolean |
filtering
|
protected TreeLoader<M> |
loader
|
protected java.util.Map<java.lang.String,TreeGrid.TreeNode> |
nodes
|
protected TreeGridView |
treeGridView
|
protected TreeStore<M> |
treeStore
|
Fields inherited from class com.extjs.gxt.ui.client.widget.grid.Grid |
---|
cm, editSupport, sm, store, stringProvider, view, viewReady |
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
TreeGrid(TreeStore store,
ColumnModel cm)
|
Method Summary | |
---|---|
protected TreePanel.Joint |
calcualteJoint(M model)
|
protected com.google.gwt.user.client.ui.AbstractImagePrototype |
calculateIconStyle(M model)
|
void |
collapseAll()
Collapses all nodes. |
protected ComponentEvent |
createComponentEvent(com.google.gwt.user.client.Event event)
|
protected void |
doApplyStoreState(java.util.Map<java.lang.String,java.lang.Object> state)
|
void |
expandAll()
Expands all nodes. |
protected int |
findLastOpenChildIndex(M model)
|
TreeGrid.TreeNode |
findNode(com.google.gwt.user.client.Element target)
Returns the tree node for the given target. |
protected TreeGrid.TreeNode |
findNode(M m)
|
protected java.lang.String |
generateModelId(M m)
|
ModelIconProvider<M> |
getIconProvider()
Returns the model icon provider. |
TreeStyle |
getStyle()
Returns the tree style. |
TreeStore<M> |
getTreeStore()
Returns the tree's tree store. |
TreeGridView |
getTreeView()
Returns the tree's view. |
protected boolean |
hasChildren(M m)
|
boolean |
isAutoExpand()
Returns true if auto expand is enabled. |
boolean |
isAutoLoad()
Returns true if auto load is enabled. |
boolean |
isCaching()
Returns true when a loader is queried for it's children each time a node is expanded. |
boolean |
isColumnLines()
Returns true if column lines are enabled. |
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. |
protected void |
onAdd(TreeStoreEvent<M> se)
|
protected void |
onAfterRenderView()
|
protected void |
onClick(GridEvent<M> e)
|
protected void |
onDataChanged(TreeStoreEvent<M> se)
|
protected void |
onDoubleClick(GridEvent<M> e)
|
protected void |
onFilter(TreeStoreEvent<M> se)
|
protected void |
onRemove(TreeStoreEvent<M> se)
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onUpdate(TreeStoreEvent<M> se)
|
void |
reconfigure(ListStore<M> store,
ColumnModel cm)
Reconfigures the grid to use a different Store and Column Model. |
void |
reconfigure(TreeStore<M> store,
ColumnModel cm)
|
protected void |
refresh(M model)
|
protected java.lang.String |
register(M m)
|
protected void |
renderChildren(M parent,
boolean auto)
|
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 |
setCaching(boolean caching)
Sets whether the children should be cached after first being retrieved from the store (defaults to true). |
void |
setColumnLines(boolean columnLines)
True to enable column separation lines (defaults to false). |
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 |
setLeaf(M model,
boolean leaf)
Sets the item's leaf state. |
void |
setView(GridView view)
Sets the view's grid (pre-render). |
void |
toggle(M model)
Toggles the model's expand state. |
protected void |
unregister(M m)
|
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onShow, onUnload, 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 |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<M extends ModelData,java.lang.String> cache
protected boolean filtering
protected TreeLoader<M extends ModelData> loader
protected java.util.Map<java.lang.String,TreeGrid.TreeNode> nodes
protected TreeGridView treeGridView
protected TreeStore<M extends ModelData> treeStore
Constructor Detail |
---|
public TreeGrid(TreeStore store, ColumnModel cm)
Method Detail |
---|
public void collapseAll()
public void expandAll()
public TreeGrid.TreeNode findNode(com.google.gwt.user.client.Element target)
target
- the target element
public ModelIconProvider<M> getIconProvider()
public TreeStyle getStyle()
public TreeStore<M> getTreeStore()
public TreeGridView getTreeView()
public boolean isAutoExpand()
public boolean isAutoLoad()
public boolean isCaching()
public boolean isColumnLines()
isColumnLines
in class Grid<M extends ModelData>
public boolean isExpanded(M model)
model
- the model
public boolean isExpandOnFilter()
public boolean isLeaf(M model)
model
- the model
public void reconfigure(ListStore<M> store, ColumnModel cm)
Grid
reconfigure
in class Grid<M extends ModelData>
store
- the new storecm
- the new column modelpublic void reconfigure(TreeStore<M> store, ColumnModel cm)
public void setAutoExpand(boolean autoExpand)
autoExpand
- the auto expand state to set.public void setAutoLoad(boolean autoLoad)
autoLoad
- true to auto loadpublic void setCaching(boolean caching)
false
, a load request will
be made each time a node is expanded.
caching
- the caching statepublic void setColumnLines(boolean columnLines)
setColumnLines
in class Grid<M extends ModelData>
columnLines
- true to enable column separation linespublic void setExpanded(M model, boolean expand)
model
- the modelexpand
- true to expandpublic 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 setLeaf(M model, boolean leaf)
model
- the modelleaf
- the leaf statepublic void setView(GridView view)
Grid
setView
in class Grid<M extends ModelData>
view
- the viewpublic void toggle(M model)
model
- the modelprotected TreePanel.Joint calcualteJoint(M model)
protected com.google.gwt.user.client.ui.AbstractImagePrototype calculateIconStyle(M model)
protected ComponentEvent createComponentEvent(com.google.gwt.user.client.Event event)
createComponentEvent
in class Grid<M extends ModelData>
protected void doApplyStoreState(java.util.Map<java.lang.String,java.lang.Object> state)
doApplyStoreState
in class Grid<M extends ModelData>
protected int findLastOpenChildIndex(M model)
protected TreeGrid.TreeNode findNode(M m)
protected java.lang.String generateModelId(M m)
protected boolean hasChildren(M m)
protected void onAdd(TreeStoreEvent<M> se)
protected void onAfterRenderView()
onAfterRenderView
in class Grid<M extends ModelData>
protected void onClick(GridEvent<M> e)
onClick
in class Grid<M extends ModelData>
protected void onDataChanged(TreeStoreEvent<M> se)
protected void onDoubleClick(GridEvent<M> e)
onDoubleClick
in class Grid<M extends ModelData>
protected void onFilter(TreeStoreEvent<M> se)
protected void onRemove(TreeStoreEvent<M> se)
protected void onRender(com.google.gwt.user.client.Element target, int index)
Component
onRender
in class Grid<M extends ModelData>
target
- the target elementindex
- the insert locationprotected void onUpdate(TreeStoreEvent<M> se)
protected void refresh(M model)
protected java.lang.String register(M m)
protected void renderChildren(M parent, boolean auto)
protected void unregister(M m)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |