|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wicket.Component wicket.MarkupContainer wicket.markup.html.WebMarkupContainer wicket.markup.html.WebMarkupContainerWithAssociatedMarkup wicket.markup.html.panel.Panel wicket.markup.html.tree.AbstractTree
public abstract class AbstractTree
Base component for trees. The trees from this package work with the Swing
tree models and DefaultMutableTreeNode
s. Hence,
users can re-use their Swing tree models.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup |
---|
WebMarkupContainerWithAssociatedMarkup.HeaderPartContainer |
Nested classes/interfaces inherited from class wicket.Component |
---|
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange |
Field Summary |
---|
Fields inherited from class wicket.Component |
---|
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
AbstractTree(java.lang.String id,
javax.swing.tree.TreeModel model)
Construct using the given model as the tree model to use. |
|
AbstractTree(java.lang.String id,
TreeState treeState)
Construct using the given tree state that holds the model to be used as the tree model. |
Method Summary | |
---|---|
void |
collapsePath(javax.swing.tree.TreePath path)
Ensures that the node identified by the specified path is collapsed and viewable. |
void |
collapseSiblings(javax.swing.tree.DefaultMutableTreeNode node)
Collapses all the siblings of a given node. |
void |
expandAll(boolean expand)
Expand or collapse all nodes. |
void |
expandPath(javax.swing.tree.TreePath path)
Ensures that the node identified by the specified path is expanded and viewable. |
TreeState |
getTreeState()
Gets the current tree state. |
boolean |
isExpanded(javax.swing.tree.DefaultMutableTreeNode node)
Convenience method that determines whether the path of the given tree node is expanded in this tree's state. |
boolean |
isExpanded(javax.swing.tree.TreePath path)
Convenience method that determines whether the given path is expanded in this tree's state. |
boolean |
isRootVisible()
Gets whether the tree root node should be displayed. |
boolean |
isVisible(javax.swing.tree.TreePath path)
Returns true if the value identified by path is currently viewable, which means it is either the root or all of its parents are expanded. |
TreeState |
newTreeState(javax.swing.tree.TreeModel model)
Creates a new tree state by creating a new TreeState object,
which is then set as the current tree state, creating a new
TreeSelectionModel and then calling setTreeModel with this |
protected TreeState |
newTreeState(javax.swing.tree.TreeModel treeModel,
boolean rootVisible)
Creates a new tree state by creating a new TreeState object,
which is then set as the current tree state, creating a new
TreeSelectionModel and then calling setTreeModel with this |
void |
setExpandedState(javax.swing.tree.DefaultMutableTreeNode node)
Sets the new expanded state, based on the given node |
void |
setExpandedState(javax.swing.tree.TreePath selection,
boolean expanded)
Sets the expanded property in the stree state for selection. |
void |
setRootVisible(boolean rootVisible)
Sets whether the tree root node should be displayed. |
void |
setSelected(javax.swing.tree.DefaultMutableTreeNode node)
Sets the new expanded state (to true), based on the given user node and set the tree path to the currently selected. |
void |
setTreeModel(javax.swing.tree.TreeModel treeModel)
Sets the current tree model. |
void |
setTreeState(TreeState treeState)
Sets the current tree state to the given tree state. |
java.lang.String |
toString()
Gives the current tree model as a string. |
Methods inherited from class wicket.markup.html.panel.Panel |
---|
onComponentTag, onComponentTagBody, renderHead |
Methods inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup |
---|
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile |
Methods inherited from class wicket.markup.html.WebMarkupContainer |
---|
getMarkupType, getWebPage |
Methods inherited from class wicket.MarkupContainer |
---|
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, visitChildren, visitChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractTree(java.lang.String id, javax.swing.tree.TreeModel model)
id
- The id of this componentmodel
- the underlying tree modelpublic AbstractTree(java.lang.String id, TreeState treeState)
id
- The id of this componenttreeState
- treeState that holds the underlying tree modelMethod Detail |
---|
public void collapsePath(javax.swing.tree.TreePath path)
path
- the TreePath
identifying a nodepublic void collapseSiblings(javax.swing.tree.DefaultMutableTreeNode node)
node
- The node of which to collapse the siblings.public void expandAll(boolean expand)
expand
- If true, expand all nodes in the tree. Else collapse all nodes
in the tree.public void expandPath(javax.swing.tree.TreePath path)
path
- the TreePath
identifying a nodepublic final TreeState getTreeState()
public final boolean isExpanded(javax.swing.tree.DefaultMutableTreeNode node)
node
- the tree node
public final boolean isExpanded(javax.swing.tree.TreePath path)
path
- the tree path
public final boolean isRootVisible()
public final boolean isVisible(javax.swing.tree.TreePath path)
path
- The path
public TreeState newTreeState(javax.swing.tree.TreeModel model)
TreeState
object,
which is then set as the current tree state, creating a new
TreeSelectionModel
and then calling setTreeModel with this
model
- the model that the new tree state applies to
public void setExpandedState(javax.swing.tree.DefaultMutableTreeNode node)
node
- the tree node modelpublic void setExpandedState(javax.swing.tree.TreePath selection, boolean expanded)
selection
- the selection to set the expanded property forexpanded
- true if the selection is expanded, false otherwisepublic void setRootVisible(boolean rootVisible)
rootVisible
- whether the tree node should be displayedpublic void setSelected(javax.swing.tree.DefaultMutableTreeNode node)
node
- the tree node modelpublic void setTreeModel(javax.swing.tree.TreeModel treeModel)
treeModel
- the tree model to set as the current onepublic void setTreeState(TreeState treeState)
treeState
- the tree state to set as the current onepublic java.lang.String toString()
toString
in class MarkupContainer
Component.toString()
protected final TreeState newTreeState(javax.swing.tree.TreeModel treeModel, boolean rootVisible)
TreeState
object,
which is then set as the current tree state, creating a new
TreeSelectionModel
and then calling setTreeModel with this
treeModel
- the model that the new tree state applies torootVisible
- whether the tree node should be displayed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |