|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
org.apache.wicket.markup.html.panel.Panel
org.apache.wicket.markup.html.tree.AbstractTree
org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree
public abstract class DefaultAbstractTree
Tree class that contains convenient functions related to presentation of the tree, which includes junction link, tree item selection link, spacers (with lines) and default tree item and folder icons.
The class itself adds no component to tree items. If you use this class directly, you have to
implement populateTreeItem() on your own. If you want to use an existing (complete) tree class,
use Tree
This class allows you to choose between 3 types of links. setLinkType(org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.LinkType)
Nested Class Summary | |
---|---|
protected static interface |
DefaultAbstractTree.ILinkCallback
Helper class for calling an action from a link. |
static class |
DefaultAbstractTree.LinkType
The type of junction links and node selection links. |
Nested classes/interfaces inherited from class org.apache.wicket.Component |
---|
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor<T extends Component>, Component.VisibilityChange |
Field Summary |
---|
Fields inherited from class org.apache.wicket.Component |
---|
ENABLE, FLAG_CONFIGURED, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
DefaultAbstractTree(String id)
Tree constructor. |
|
DefaultAbstractTree(String id,
IModel<TreeModel> model)
Tree constructor. |
|
DefaultAbstractTree(String id,
TreeModel model)
Tree constructor. |
Method Summary | |
---|---|
protected ResourceReference |
getCSS()
Returns the resource reference of default stylesheet. |
protected ResourceReference |
getFolderClosed()
Returns the resource reference of default closed tree folder. |
protected ResourceReference |
getFolderOpen()
Returns the resource reference of default open tree folder. |
protected ResourceReference |
getItem()
Returns the resource reference of default tree item (not folder). |
DefaultAbstractTree.LinkType |
getLinkType()
Returns the current type of links on tree items. |
protected ResourceReference |
getNodeIcon(TreeNode node)
Returns the resource reference for icon of specified tree node. |
protected Component |
newIndentation(MarkupContainer parent,
String id,
TreeNode node,
int level)
Creates the indentation element. |
protected MarkupContainer |
newJunctionImage(MarkupContainer parent,
String id,
TreeNode node)
Creates an image placed on junction link. |
protected Component |
newJunctionLink(MarkupContainer parent,
String id,
String imageId,
TreeNode node)
Creates the junction link for given node. |
protected MarkupContainer |
newLink(MarkupContainer parent,
String id,
DefaultAbstractTree.ILinkCallback callback)
Creates a link of type specified by current linkType. |
protected Component |
newNodeIcon(MarkupContainer parent,
String id,
TreeNode node)
Creates the icon for current node. |
protected MarkupContainer |
newNodeLink(MarkupContainer parent,
String id,
TreeNode node)
Creates a link that can be used to select / deselect the specified node. |
protected void |
onJunctionLinkClicked(AjaxRequestTarget target,
TreeNode node)
Callback function called after user clicked on an junction link. |
protected void |
onNodeLinkClicked(AjaxRequestTarget target,
TreeNode node)
This callback method is called after user has selected / deselected the given node. |
void |
setLinkType(DefaultAbstractTree.LinkType linkType)
Sets the type of links on tree items. |
Methods inherited from class org.apache.wicket.markup.html.tree.AbstractTree |
---|
addComponent, allNodesCollapsed, allNodesExpanded, getChildAt, getChildCount, getModel, getModelObject, getNodeComponent, getParentNode, getTreeState, invalidateAll, isForceRebuildOnSelectionChange, isLeaf, isNodeExpanded, isRootLess, markNodeChildrenDirty, markNodeDirty, newTreeState, nodeChildren, nodeCollapsed, nodeExpanded, nodeSelected, nodeUnselected, onAfterRender, onBeforeAttach, onBeforeRender, onDetach, onTargetRespond, populateTreeItem, setModel, setModelObject, setRootLess, treeNodesChanged, treeNodesInserted, treeNodesRemoved, treeStructureChanged, updateTree, updateTree |
Methods inherited from class org.apache.wicket.markup.html.panel.Panel |
---|
onComponentTag, onComponentTagBody, renderHead |
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup |
---|
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile |
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
---|
getMarkupType, getWebPage, getWebRequest |
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onAfterRenderChildren, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultAbstractTree(String id)
id
- The component idpublic DefaultAbstractTree(String id, IModel<TreeModel> model)
id
- The component idmodel
- The tree modelpublic DefaultAbstractTree(String id, TreeModel model)
id
- The component idmodel
- The tree modelMethod Detail |
---|
public DefaultAbstractTree.LinkType getLinkType()
public void setLinkType(DefaultAbstractTree.LinkType linkType)
linkType
- type of linksprotected ResourceReference getCSS()
protected ResourceReference getFolderClosed()
protected ResourceReference getFolderOpen()
protected ResourceReference getItem()
protected ResourceReference getNodeIcon(TreeNode node)
node
- The node
protected Component newIndentation(MarkupContainer parent, String id, TreeNode node, int level)
parent
- The component parentid
- The component idnode
- The tree node for which to create the indentation elementlevel
- The current level
protected MarkupContainer newJunctionImage(MarkupContainer parent, String id, TreeNode node)
parent
- The component parentid
- The component idnode
- The tree node
protected Component newJunctionLink(MarkupContainer parent, String id, String imageId, TreeNode node)
parent
- parent component of the linkid
- wicket:id of the componentimageId
- wicket:id of the image. this can be null, in that case image is not created. image
is supposed to be placed on the link (link is parent of image)node
- tree node for which the link should be created.
protected MarkupContainer newLink(MarkupContainer parent, String id, DefaultAbstractTree.ILinkCallback callback)
parent
- The parent componentid
- The component idcallback
- The link call back
protected Component newNodeIcon(MarkupContainer parent, String id, TreeNode node)
getNodeIcon(TreeNode)
.
parent
- The parent componentid
- The component idnode
- The tree node
protected MarkupContainer newNodeLink(MarkupContainer parent, String id, TreeNode node)
parent
- The parent componentid
- The component idnode
- The parent node
protected void onJunctionLinkClicked(AjaxRequestTarget target, TreeNode node)
target
- Request target - may be null on non-ajax callnode
- Node for which this callback is relevantprotected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node)
target
- Request target - may be null on non-ajax callnode
- Node for which this this callback is fired.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |