org.apache.tapestry.link
Class DefaultLinkRenderer

java.lang.Object
  extended by org.apache.tapestry.link.DefaultLinkRenderer
All Implemented Interfaces:
ILinkRenderer
Direct Known Subclasses:
AbsoluteLinkRenderer, AreaLinkRenderer, GoLinkRenderer, OptionRenderer, PopupLinkRenderer

public class DefaultLinkRenderer
extends Object
implements ILinkRenderer

Default implementation of ILinkRenderer, which does nothing special. Can be used as a base class to provide additional handling.

Since:
3.0
Version:
$Id: DefaultLinkRenderer.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship, David Solis

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(ILink link, String anchor, IRequestCycle cycle)
          Converts the EngineServiceLink into a URI or URL.
protected  String getElement()
           
protected  boolean getHasBody()
           
protected  String getUrlAttribute()
           
 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

SHARED_INSTANCE

public static final ILinkRenderer SHARED_INSTANCE
A shared instance used as a default for any link that doesn't explicitly override.

Constructor Detail

DefaultLinkRenderer

public DefaultLinkRenderer()
Method Detail

renderLink

public void renderLink(IMarkupWriter writer,
                       IRequestCycle cycle,
                       ILinkComponent linkComponent)
Description copied from interface: ILinkRenderer
Renders the link, taking into account whether the link is 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.

Specified by:
renderLink in interface ILinkRenderer

constructURL

protected String constructURL(ILink link,
                              String anchor,
                              IRequestCycle cycle)
Converts the EngineServiceLink into a URI or URL. This implementation simply invokes ILink.getURL(String, boolean).


beforeBodyRender

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).

This implementation does nothing.


afterBodyRender

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).

This implementation does nothing.


getElement

protected String getElement()
Since:
3.0

getUrlAttribute

protected String getUrlAttribute()

getHasBody

protected boolean getHasBody()