|
||||||||||
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.markup.html.tree.BaseTree
public abstract class BaseTree
An abstract Tree component that should serve as a base for custom Tree Components.
It has one abstract method - newNodeComponent(String, IModel)
that needs to be
overridden.
Nested Class Summary | |
---|---|
static interface |
BaseTree.ILinkCallback
Helper class for calling an action from a link. |
static class |
BaseTree.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, PARENT_PATH, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
BaseTree(String id)
Construct. |
|
BaseTree(String id,
IModel<TreeModel> model)
Construct. |
Method Summary | |
---|---|
protected ResourceReference |
getCSS()
Returns the stylesheet reference |
protected String |
getItemClass(Object node)
|
BaseTree.LinkType |
getLinkType()
Returns the current type of links on tree items. |
protected String |
getSelectedClass()
Returns the class name that will be added to row's CSS class for selected rows |
protected boolean |
isForceRebuildOnSelectionChange()
Determines whether the TreeNode needs to be rebuilt if it is selected or deselected |
protected Component |
newJunctionLink(MarkupContainer parent,
String id,
Object node)
Creates the junction link for given node. |
MarkupContainer |
newLink(String id,
BaseTree.ILinkCallback callback)
Creates a link of type specified by current linkType. |
protected abstract Component |
newNodeComponent(String id,
IModel<Object> model)
Creates a new component for the given TreeNode. |
protected void |
onJunctionLinkClicked(AjaxRequestTarget target,
Object node)
Callback function called after user clicked on an junction link. |
protected void |
populateTreeItem(WebMarkupContainer item,
int level)
This method is called after creating every TreeItem. |
void |
setLinkType(BaseTree.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, isLeaf, isNodeExpanded, isRootLess, markNodeChildrenDirty, markNodeDirty, newTreeState, nodeChildren, nodeCollapsed, nodeExpanded, nodeSelected, nodeUnselected, onAfterRender, onBeforeAttach, onBeforeRender, onDetach, onTargetRespond, 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 BaseTree(String id)
id
- public BaseTree(String id, IModel<TreeModel> model)
id
- model
- Method Detail |
---|
protected ResourceReference getCSS()
protected void populateTreeItem(WebMarkupContainer item, int level)
AbstractTree
populateTreeItem
in class AbstractTree
item
- newly created tree item. The node can be obtained as item.getModelObject()level
- how deep the component is in tree hierarchy (0 for root item)AbstractTree.populateTreeItem(org.apache.wicket.markup.html.WebMarkupContainer,
int)
protected String getItemClass(Object node)
protected String getSelectedClass()
protected abstract Component newNodeComponent(String id, IModel<Object> model)
id
- component IDmodel
- model that returns the node
protected Component newJunctionLink(MarkupContainer parent, String id, Object node)
parent
- parent component of the linkid
- wicket:id of the componentnode
- tree node for which the link should be created.
protected void onJunctionLinkClicked(AjaxRequestTarget target, Object node)
target
- Request target - may be null on non-ajax callnode
- Node for which this callback is relevantpublic MarkupContainer newLink(String id, BaseTree.ILinkCallback callback)
id
- The component idcallback
- The link call back
public BaseTree.LinkType getLinkType()
public void setLinkType(BaseTree.LinkType linkType)
linkType
- type of linksprotected boolean isForceRebuildOnSelectionChange()
AbstractTree
isForceRebuildOnSelectionChange
in class AbstractTree
AbstractTree.isForceRebuildOnSelectionChange()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |