|
||||||||||
| 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.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. |
| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.markup.html.panel.Panel |
|---|
PANEL |
| Fields inherited from class org.apache.wicket.Component |
|---|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
BaseTree(String id)
Construct. |
|
BaseTree(String id,
IModel<? extends TreeModel> model)
Construct. |
|
| Method Summary | |
|---|---|
protected ResourceReference |
getCSS()
Returns the stylesheet reference |
protected String |
getItemClass(Object node)
|
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 |
renderHead(IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section. |
void |
setLinkType(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 |
|---|
newMarkupSourcingStrategy |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
|---|
getWebPage, getWebRequest |
| Methods inherited from class org.apache.wicket.MarkupContainer |
|---|
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, hasAssociatedMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onMarkupAttached, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, 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<? extends TreeModel> model)
id - model - | Method Detail |
|---|
protected ResourceReference getCSS()
protected void populateTreeItem(WebMarkupContainer item,
int level)
AbstractTree
populateTreeItem in class AbstractTreeitem - 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 relevant
public MarkupContainer newLink(String id,
BaseTree.ILinkCallback callback)
id - The component idcallback - The link call back. null is passed for its onClick(AjaxRequestTarget) for
LinkType.REGULAR and eventually for LinkType.AJAX_FALLBACK.
public LinkType getLinkType()
public void setLinkType(LinkType linkType)
linkType - type of linksprotected boolean isForceRebuildOnSelectionChange()
AbstractTree
isForceRebuildOnSelectionChange in class AbstractTreeAbstractTree.isForceRebuildOnSelectionChange()public void renderHead(IHeaderResponse response)
Component
renderHead in interface IHeaderContributorrenderHead in class AbstractTreeresponse - Response object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||