|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.markup.parser.AbstractMarkupFilter
org.apache.wicket.markup.parser.filter.BaseMarkupFilter
org.apache.wicket.markup.parser.filter.WicketLinkTagHandler
public class WicketLinkTagHandler
This is a markup inline filter. It identifies xml tags which include a href attribute and which are not Wicket specific components and flags these tags (ComponentTag) as autolink enabled. A component resolver will later resolve the href and assign a BookmarkablePageLink to it (automatically).
An application setting is used as default value, which might be modified for specific regions. These regions are identified by <wicket:link> tags with an optional 'autolink' attribute. The default value for the attribute is true, thus enabling autolinking. An open-close <wicket:link/> tag will change the autolink status until the end of the markup document or the next <wicket:link> tag respectively. <wicket:link> regions may be nested.
Field Summary | |
---|---|
static java.lang.String |
AUTOLINK_ID
The id of autolink components |
static java.lang.String |
LINK
|
Constructor Summary | |
---|---|
WicketLinkTagHandler()
Construct. |
Method Summary | |
---|---|
protected boolean |
analyzeAutolinkCondition(ComponentTag tag)
Analyze the tag. |
protected MarkupElement |
nextTag(ComponentTag tag)
Invoked with the next ComponentTag |
Component |
resolve(MarkupContainer container,
MarkupStream markupStream,
ComponentTag tag)
Try to resolve the tag, then create a component, add it to the container and render it. |
void |
setAutomaticLinking(boolean enable)
Set the default value for autolinking |
Methods inherited from class org.apache.wicket.markup.parser.filter.BaseMarkupFilter |
---|
nextTag |
Methods inherited from class org.apache.wicket.markup.parser.AbstractMarkupFilter |
---|
getCount, getNextFilter, nextComponentTag, setNextFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LINK
public static final java.lang.String AUTOLINK_ID
Constructor Detail |
---|
public WicketLinkTagHandler()
Method Detail |
---|
public void setAutomaticLinking(boolean enable)
enable
- if true, autolinks are enabledprotected final MarkupElement nextTag(ComponentTag tag) throws java.text.ParseException
BaseMarkupFilter
nextTag
in class BaseMarkupFilter
java.text.ParseException
BaseMarkupFilter.nextTag(org.apache.wicket.markup.ComponentTag)
protected boolean analyzeAutolinkCondition(ComponentTag tag)
Subclass analyzeAutolinkCondition() to implement you own implementation and register the new tag handler with the markup parser through Application.newMarkupParser().
tag
- The current tag being parsed
public Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag)
IComponentResolver
resolve
in interface IComponentResolver
container
- The container parsing its markupmarkupStream
- The current markupStreamtag
- The current component tag while parsing the markup
IComponentResolver.resolve(org.apache.wicket.MarkupContainer,
org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |