org.apache.wicket.markup.html.tree
Class LabelIconPanel

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.WebMarkupContainerWithAssociatedMarkup
                  extended by org.apache.wicket.markup.html.panel.Panel
                      extended by org.apache.wicket.markup.html.tree.LabelIconPanel
All Implemented Interfaces:
Serializable, IClusterable, IConverterLocator, IHeaderPartContainerProvider
Direct Known Subclasses:
LinkIconPanel

public class LabelIconPanel
extends Panel

Simple panel that contains an icon next to a label.

Author:
Matej Knopp
See Also:
Serialized Form

Nested Class Summary
 
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
LabelIconPanel(String id, IModel<Object> model, BaseTree tree)
          Constructs the panel.
 
Method Summary
protected  void addComponents(IModel<Object> model, BaseTree tree)
          Adds the icon and content components to the panel.
protected  ResourceReference getImageResourceReference(BaseTree tree, Object node)
          Returns the image resource reference based on the give tree node type.
protected  ResourceReference getResourceFolderClosed(Object node)
          Returns resource reference for closed folder icon.
protected  ResourceReference getResourceFolderOpen(Object node)
          Returns resource reference for open folder icon.
protected  ResourceReference getResourceItemLeaf(Object node)
          Returns resource reference for a leaf icon.
protected  Component newContentComponent(String componentId, BaseTree tree, IModel<Object> model)
          Creates the content component (label in this case) for the node
protected  Component newImageComponent(String componentId, BaseTree tree, IModel<Object> model)
          Creates the icon component for the node
protected  IModel<Object> wrapNodeModel(IModel<Object> nodeModel)
          Optional method for wrapping (creating an intermediate model) for the tree node model
 
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 org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, 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, onInitialize, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelIconPanel

public LabelIconPanel(String id,
                      IModel<Object> model,
                      BaseTree tree)
Constructs the panel.

Parameters:
id - component id
model - model that is used to access the TreeNode
tree -
Method Detail

addComponents

protected void addComponents(IModel<Object> model,
                             BaseTree tree)
Adds the icon and content components to the panel. You can override this method if you want custom components to be added

Parameters:
model - model that can be used to retrieve the TreeNode
tree -

newImageComponent

protected Component newImageComponent(String componentId,
                                      BaseTree tree,
                                      IModel<Object> model)
Creates the icon component for the node

Parameters:
componentId -
tree -
model -
Returns:
icon image component

newContentComponent

protected Component newContentComponent(String componentId,
                                        BaseTree tree,
                                        IModel<Object> model)
Creates the content component (label in this case) for the node

Parameters:
componentId -
tree -
model -
Returns:
content component

getImageResourceReference

protected ResourceReference getImageResourceReference(BaseTree tree,
                                                      Object node)
Returns the image resource reference based on the give tree node type.

Parameters:
tree -
node -
Returns:
image resource reference

wrapNodeModel

protected IModel<Object> wrapNodeModel(IModel<Object> nodeModel)
Optional method for wrapping (creating an intermediate model) for the tree node model

Parameters:
nodeModel -
Returns:
wrapped model

getResourceFolderClosed

protected ResourceReference getResourceFolderClosed(Object node)
Returns resource reference for closed folder icon.

Parameters:
node -
Returns:
resource reference

getResourceFolderOpen

protected ResourceReference getResourceFolderOpen(Object node)
Returns resource reference for open folder icon.

Parameters:
node -
Returns:
resource reference

getResourceItemLeaf

protected ResourceReference getResourceItemLeaf(Object node)
Returns resource reference for a leaf icon.

Parameters:
node -
Returns:
resource reference


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.