public class MultilineLabelWithClickableLinks
extends org.apache.wicket.markup.html.basic.Label
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
linkPattern
Matches "foo://foo.foo/foo".
|
| Constructor and Description |
|---|
MultilineLabelWithClickableLinks(String id,
org.apache.wicket.model.IModel<?> model) |
MultilineLabelWithClickableLinks(String id,
Serializable label) |
| Modifier and Type | Method and Description |
|---|---|
static CharSequence |
encodeLinksToHtml(CharSequence plainText)
Takes some plain text and returns HTML with URLs marked up as clickable links.
|
void |
onComponentTagBody(org.apache.wicket.markup.MarkupStream markupStream,
org.apache.wicket.markup.ComponentTag openTag) |
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession, onRenderadd, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, get, 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, internalInitialize, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModel, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, toString, toString, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrapprotected static final Pattern linkPattern
Quotes are not allowed because we don't want <a href="foo"> to have foo containing quotes (XSS).
public MultilineLabelWithClickableLinks(String id, Serializable label)
public MultilineLabelWithClickableLinks(String id, org.apache.wicket.model.IModel<?> model)
public static CharSequence encodeLinksToHtml(CharSequence plainText)
Making links clickable is not as easy as it seems.
Therefore,
Therefore, the replacement of HTML entities, and the replacement of links, must be done in a single pass, not one after another.
plainText - Plain text, no HTML.public void onComponentTagBody(org.apache.wicket.markup.MarkupStream markupStream,
org.apache.wicket.markup.ComponentTag openTag)
onComponentTagBody in class org.apache.wicket.markup.html.basic.LabelCopyright © 2003–2018. All rights reserved.