|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.link.DefaultLinkRenderer
public class DefaultLinkRenderer
Default implementation of ILinkRenderer
,
which does nothing special. Can be used as a base class to provide additional
handling.
Field Summary | |
---|---|
static ILinkRenderer |
SHARED_INSTANCE
A shared instance used as a default for any link that doesn't explicitly override. |
Constructor Summary | |
---|---|
DefaultLinkRenderer()
|
Method Summary | |
---|---|
protected void |
afterBodyRender(IMarkupWriter writer,
IRequestCycle cycle,
ILinkComponent link)
Invoked after the body of the link is rendered, but before ILinkComponent.renderAdditionalAttributes(IMarkupWriter, IRequestCycle) is
invoked (but only if the link is not disabled). |
protected void |
beforeBodyRender(IMarkupWriter writer,
IRequestCycle cycle,
ILinkComponent link)
Invoked after the href attribute has been written but before the body of the link is rendered (but only if the link is not disabled). |
protected String |
constructURL(ILinkComponent component,
IRequestCycle cycle)
Converts the EngineServiceLink into a URI or URL. |
protected String |
getElement()
|
protected boolean |
getHasBody()
|
protected String |
getTargetAttribute()
|
protected String |
getUrlAttribute()
|
protected void |
renderAsyncParams(IMarkupWriter writer,
IRequestCycle cycle,
DirectLink link)
For DirectLink components only, manages writing out event handlers for link
if any of the dynamic (async/json/etc) parameters are set on the component. |
void |
renderLink(IMarkupWriter writer,
IRequestCycle cycle,
ILinkComponent linkComponent)
Renders the link, taking into account whether the link is disabled . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ILinkRenderer SHARED_INSTANCE
Constructor Detail |
---|
public DefaultLinkRenderer()
Method Detail |
---|
public void renderLink(IMarkupWriter writer, IRequestCycle cycle, ILinkComponent linkComponent)
ILinkRenderer
disabled
.
This is complicated by the fact that the rendering of the body must be done
within a nested writer, since the Link component will not render its tag
until after its body renders (to allow for any wrapped components that need
to write event handlers for the link).
The renderer is expected to call back into the link component to handle any informal parameters, and to handle events output.
renderLink
in interface ILinkRenderer
protected String constructURL(ILinkComponent component, IRequestCycle cycle)
ILink.getURL(String, String, int, String, boolean)
.
protected void beforeBodyRender(IMarkupWriter writer, IRequestCycle cycle, ILinkComponent link)
This implementation does nothing.
writer
- Markup writer.cycle
- Current request cycle.link
- The link component being rendered.protected void afterBodyRender(IMarkupWriter writer, IRequestCycle cycle, ILinkComponent link)
ILinkComponent.renderAdditionalAttributes(IMarkupWriter, IRequestCycle)
is
invoked (but only if the link is not disabled).
This implementation does nothing.
writer
- Markup writer.cycle
- Current request cycle.link
- The link component being rendered.protected void renderAsyncParams(IMarkupWriter writer, IRequestCycle cycle, DirectLink link)
DirectLink
components only, manages writing out event handlers for link
if any of the dynamic (async/json/etc) parameters are set on the component.
Will try to write the logic into the onClick
attribute of the link
if not bound, otherwise it will render it using the DirectLink.getScript()
script.
writer
- The writer to render attributes into.cycle
- The current request cycle.link
- The component link being rendered for.protected String getElement()
protected String getUrlAttribute()
protected String getTargetAttribute()
protected boolean getHasBody()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |