org.apache.wicket.extensions.markup.html.repeater.tree.content
Class Folder<T>

java.lang.Object
  extended by org.apache.wicket.Component
      extended by org.apache.wicket.MarkupContainer
          extended by org.apache.wicket.markup.html.WebMarkupContainer
              extended by org.apache.wicket.markup.html.panel.Panel
                  extended by org.apache.wicket.extensions.markup.html.repeater.tree.content.StyledLinkLabel<T>
                      extended by org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder<T>
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IConverterLocator, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
CheckedFolder, CheckFolder

public class Folder<T>
extends StyledLinkLabel<T>

A typical folder representation of nodes in a tree. The link is used to expand/collapse the tree depending on the AbstractTree.State of the current node. Nodes without children are not clickable. Subclasses may change this behavior by overriding isClickable() and onClick(AjaxRequestTarget).

Author:
svenmeier
See Also:
Serialized Form

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
Folder(String id, AbstractTree<T> tree, IModel<T> model)
           
 
Method Summary
protected  String getClosedStyleClass()
           
protected  String getOpenStyleClass()
           
protected  String getOtherStyleClass(T t)
          Get a style class for anything other than closed or open folders.
protected  String getSelectedStyleClass()
          Get a style class to render for a selected folder.
protected  String getStyleClass()
          Delegates to others methods depending wether the given model is a folder, expanded, collapsed or selected.
protected  boolean isClickable()
          Clickable if node can be expanded/collapsed, i.e.
protected  boolean isSelected()
          Optional attribute which decides if an additional "selected" style class should be rendered.
protected  void onClick(AjaxRequestTarget target)
          Toggle the node's AbstractTree.State on click.
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.tree.content.StyledLinkLabel
getModel, getModelObject, newLabelComponent, newLabelModel, newLinkComponent
 
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, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
 
Methods inherited from class org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Folder

public Folder(String id,
              AbstractTree<T> tree,
              IModel<T> model)
Method Detail

isClickable

protected boolean isClickable()
Clickable if node can be expanded/collapsed, i.e. has children.

Overrides:
isClickable in class StyledLinkLabel<T>
See Also:
ITreeProvider.hasChildren(Object)

onClick

protected void onClick(AjaxRequestTarget target)
Toggle the node's AbstractTree.State on click.

Overrides:
onClick in class StyledLinkLabel<T>
See Also:
StyledLinkLabel.newLinkComponent(String, IModel), StyledLinkLabel.isClickable()

getStyleClass

protected String getStyleClass()
Delegates to others methods depending wether the given model is a folder, expanded, collapsed or selected.

Specified by:
getStyleClass in class StyledLinkLabel<T>
See Also:
ITreeProvider.hasChildren(Object), AbstractTree.getState(Object), isSelected(), getOpenStyleClass(), getClosedStyleClass(), getOtherStyleClass(Object), getSelectedStyleClass()

isSelected

protected boolean isSelected()
Optional attribute which decides if an additional "selected" style class should be rendered.

Returns:
defaults to false

getOtherStyleClass

protected String getOtherStyleClass(T t)
Get a style class for anything other than closed or open folders.


getClosedStyleClass

protected String getClosedStyleClass()

getOpenStyleClass

protected String getOpenStyleClass()

getSelectedStyleClass

protected String getSelectedStyleClass()
Get a style class to render for a selected folder.

See Also:
isSelected()


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.