org.apache.wicket.extensions.markup.html.basic
Class SmartLinkLabel

java.lang.Object
  extended by org.apache.wicket.Component
      extended by org.apache.wicket.markup.html.WebComponent
          extended by org.apache.wicket.markup.html.basic.Label
              extended by org.apache.wicket.extensions.markup.html.basic.SmartLinkLabel
All Implemented Interfaces:
java.io.Serializable, IClusterable, IConverterLocator

public class SmartLinkLabel
extends Label

If you have email addresses or web URLs in the data that you are displaying, then you can automatically display those pieces of data as hyperlinks, you will not have to take any action to convert that data.

Email addresses will be wrapped with a <a href="mailto:xxx">xxx</a> tag, where "xxx" is the email address that was detected.

Web URLs will be wrapped with a <a href="xxx">xxx</a> tag, where "xxx" is the URL that was detected (it can be any valid URL type, http://, https://, ftp://, etc...)

Author:
Juergen Donnerstag
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.Component
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange
 
Field Summary
 
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Constructor Summary
SmartLinkLabel(java.lang.String name)
           
SmartLinkLabel(java.lang.String name, IModel model)
           
SmartLinkLabel(java.lang.String name, java.lang.String label)
           
 
Method Summary
protected  ILinkParser getLinkParser()
           
protected  java.lang.CharSequence getSmartLink(java.lang.CharSequence text)
          Replace all email and URL addresses
protected  void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
          Processes the body.
 
Methods inherited from class org.apache.wicket.markup.html.basic.Label
onComponentTag
 
Methods inherited from class org.apache.wicket.markup.html.WebComponent
onRender
 
Methods inherited from class org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getModelObjectAsString, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageFactory, 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, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onDetach, onEndRequest, onModelChanged, onModelChanging, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupStream, setMetaData, setModel, setModelObject, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, toString, toString, 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

SmartLinkLabel

public SmartLinkLabel(java.lang.String name,
                      java.lang.String label)
See Also:
Label.Label(String, String)

SmartLinkLabel

public SmartLinkLabel(java.lang.String name,
                      IModel model)
See Also:
Label.Label(String, IModel)

SmartLinkLabel

public SmartLinkLabel(java.lang.String name)
See Also:
Label.Label(String)
Method Detail

onComponentTagBody

protected void onComponentTagBody(MarkupStream markupStream,
                                  ComponentTag openTag)
Description copied from class: Component
Processes the body.

Overrides:
onComponentTagBody in class Label
Parameters:
markupStream - The markup stream
openTag - The open tag for the body
See Also:
Component.onComponentTagBody(org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag)

getLinkParser

protected ILinkParser getLinkParser()

getSmartLink

protected final java.lang.CharSequence getSmartLink(java.lang.CharSequence text)
Replace all email and URL addresses

Parameters:
text - Text to be modified
Returns:
Modified Text


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