public abstract class CategoryPanel<T> extends org.apache.wicket.markup.html.panel.Panel implements ChangeGenerator<T>
ChangeGenerator
; it will also generate Events of TypeModifier and Type | Field and Description |
---|---|
protected boolean |
expandedState |
protected List<ChangeListener<T>> |
listeners |
protected boolean |
loadLeaves |
Constructor and Description |
---|
CategoryPanel(String id,
org.apache.wicket.model.IModel<T> model,
boolean loadLeaves) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener changeListener)
Notify all
ChangeListener s about a change |
protected TreeModel |
convertToTreeModel(List<T> list)
Converts a List type tree to actual Tree model
|
protected abstract org.apache.wicket.markup.html.tree.LinkTree |
createLinkTree(String id,
TreeModel treeModel)
One can intercept LinkTree Ajax requests via its
LinkTree.onNodeLinkClicked(java.lang.Object, org.apache.wicket.markup.html.tree.BaseTree, org.apache.wicket.ajax.AjaxRequestTarget) etc. |
protected TreeModel |
createTreeModel()
Creates the model that feeds the tree.
|
protected abstract List<T> |
getDataList(T parentNode)
Fetch the Data as a Data List.
|
List |
getListeners()
Get list directly.
|
org.apache.wicket.model.IModel<T> |
getModel() |
protected org.apache.wicket.markup.html.tree.AbstractTree |
getTree(String id) |
boolean |
isExpandedState() |
boolean |
isLoadLeaves() |
protected void |
modifyNode(DefaultMutableTreeNode node,
T modelForNode)
Allow overriding and manipulating of a Node
|
void |
notifyAllListeners(T object)
Whenever a node is selected, it also notifies its listeners.
|
void |
onInitialize() |
void |
onInitialize(List<T> list)
Initialize using some external list, liek a Search result or Authorized filetered list
|
void |
setExpandedState(boolean expandedState) |
void |
setListeners(List listeners)
Set list directly.
|
void |
setLoadLeaves(boolean loadLeaves) |
void |
setState(org.apache.wicket.model.IModel<T> category) |
onComponentTag, onComponentTagBody, renderHead
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile
getMarkupType, getWebPage, getWebRequest
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdImpl, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onConfigure, onDetach, onEndRequest, onModelChanged, onModelChanging, onRemove, prepareForRender, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap
protected boolean loadLeaves
protected boolean expandedState
protected transient List<ChangeListener<T>> listeners
public void onInitialize()
onInitialize
in class org.apache.wicket.Component
public void onInitialize(List<T> list)
list
- public void setState(org.apache.wicket.model.IModel<T> category)
public org.apache.wicket.model.IModel<T> getModel()
protected org.apache.wicket.markup.html.tree.AbstractTree getTree(String id)
protected abstract org.apache.wicket.markup.html.tree.LinkTree createLinkTree(String id, TreeModel treeModel)
LinkTree.onNodeLinkClicked(java.lang.Object, org.apache.wicket.markup.html.tree.BaseTree, org.apache.wicket.ajax.AjaxRequestTarget)
etc.
Define custom/anon class so you can intercept Ajax requests.tree
- as LinkTree
public void notifyAllListeners(T object)
notifyAllListeners
in interface ChangeGenerator<T>
object
- protected abstract List<T> getDataList(T parentNode)
parentNode
- as T @nullable true (if root)protected TreeModel createTreeModel()
protected TreeModel convertToTreeModel(List<T> list)
list
- {@link ModuleHelpers#hierarchyFilter(List, boolean)}
protected void modifyNode(DefaultMutableTreeNode node, T modelForNode)
node
- public boolean isLoadLeaves()
public void setLoadLeaves(boolean loadLeaves)
public boolean isExpandedState()
public void setExpandedState(boolean expandedState)
public void addChangeListener(ChangeListener changeListener)
ChangeListener
s about a changeaddChangeListener
in interface ChangeGenerator<T>
changeListener
- public List getListeners()
ChangeGenerator
getListeners
in interface ChangeGenerator<T>
public void setListeners(List listeners)
ChangeGenerator
setListeners
in interface ChangeGenerator<T>
Copyright © 2018. All rights reserved.