org.apache.tapestry.components
Interface ILinkComponent

All Superinterfaces:
IComponent, ILocatable, ILocationHolder, IRender
All Known Implementing Classes:
AbstractLinkComponent, ActionLink, DirectLink, ExternalLink, GenericLink, PageLink, ServiceLink

public interface ILinkComponent
extends IComponent

A component that renders an HTML <a> element. It exposes some properties to the components it wraps. This is basically to facilitate the Rollover component.

Version:
$Id: ILinkComponent.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Method Summary
 void addEventHandler(LinkEventType type, String functionName)
          Adds a new event handler.
 String getAnchor()
          Returns the anchor defined for this link, or null for no anchor.
 ILink getLink(IRequestCycle cycle)
          Invoked by the ILinkRenderer (if the link is not disabled) to provide a EngineServiceLink that the renderer can convert into a URL.
 boolean isDisabled()
          Returns whether this service link component is enabled or disabled.
 void renderAdditionalAttributes(IMarkupWriter writer, IRequestCycle cycle)
          Invoked (by the ILinkRenderer) to make the link render any additional attributes.
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Method Detail

isDisabled

boolean isDisabled()
Returns whether this service link component is enabled or disabled.

Since:
0.2.9

getAnchor

String getAnchor()
Returns the anchor defined for this link, or null for no anchor.

Since:
3.0

addEventHandler

void addEventHandler(LinkEventType type,
                     String functionName)
Adds a new event handler. When the event occurs, the JavaScript function specified is executed. Multiple functions can be specified, in which case all of them are executed.

This was created for use by Rollover to set mouse over and mouse out handlers on the ILinkComponent that wraps it, but can be used for many other things as well.

Since:
0.2.9

getLink

ILink getLink(IRequestCycle cycle)
Invoked by the ILinkRenderer (if the link is not disabled) to provide a EngineServiceLink that the renderer can convert into a URL.


renderAdditionalAttributes

void renderAdditionalAttributes(IMarkupWriter writer,
                                IRequestCycle cycle)
Invoked (by the ILinkRenderer) to make the link render any additional attributes. These are informal parameters, plus any attributes related to events. This is only invoked for non-disabled links.

Since:
3.0