org.apache.tapestry.contrib.link
Class ButtonLinkRenderer
java.lang.Object
org.apache.tapestry.contrib.link.ButtonLinkRenderer
- All Implemented Interfaces:
- ILinkRenderer
public class ButtonLinkRenderer
- extends Object
- implements ILinkRenderer
An ILinkRenderer
implementation that generates an HTML button.
This is particularly useful for implementing cancel buttons.
- Since:
- 4.0
- Author:
- Paul Ferraro
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SHARED_INSTANCE
public static final ILinkRenderer SHARED_INSTANCE
ButtonLinkRenderer
public ButtonLinkRenderer()
renderLink
public void renderLink(IMarkupWriter writer,
IRequestCycle cycle,
ILinkComponent component)
- 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
- See Also:
ILinkRenderer.renderLink(org.apache.tapestry.IMarkupWriter,
org.apache.tapestry.IRequestCycle, org.apache.tapestry.components.ILinkComponent)
getScript
protected String getScript(String url)
- Generates the onclick event handler that opens the specified url in the current window.
- Parameters:
url
- the url generated by this link
- Returns:
- a JavaScript onclick event handler
getScript
protected String getScript(String url,
String target)
- Generates the onclick event handler that opens the specified url in the specified window or frame.
- Parameters:
url
- the url generated by this linktarget
- the name of the target window or frame
- Returns:
- a JavaScript onclick event handler
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.