org.apache.tapestry.components
Interface ILinkComponent

All Superinterfaces:
IComponent, IRender, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder
All Known Implementing Classes:
AbstractLinkComponent, 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.

Author:
Howard Lewis Ship

Method Summary
 void addEventHandler(LinkEventType type, String functionName)
          Deprecated. To be removed in Tapestry 4.1.4.
 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.
 Integer getPort()
          Returns the desired port (i.e., "80" or "443") for the link, or null to not output a specific port (in which case the URL will fall under the incoming request's port).
 String getScheme()
          Returns the desired scheme (i.e., "http" or "https") for the link, or null to not output a specific scheme (in which case the URL will fall under the incoming request's scheme).
 String getTarget()
          Returns the name of the target window or frame for this link, or null if current window or frame is to be used.
 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, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Method Detail

getScheme

String getScheme()
Returns the desired scheme (i.e., "http" or "https") for the link, or null to not output a specific scheme (in which case the URL will fall under the incoming request's scheme).

Returns:
The scheme portion of the url to be generated.
Since:
4.0

getPort

Integer getPort()
Returns the desired port (i.e., "80" or "443") for the link, or null to not output a specific port (in which case the URL will fall under the incoming request's port).

Returns:
The http port to use.
Since:
4.1

isDisabled

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

Returns:
True if disabled, false otherwise.
Since:
0.2.9

getAnchor

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

Returns:
The #anchorid portion of the url to be generated - if any.
Since:
3.0

getTarget

String getTarget()
Returns the name of the target window or frame for this link, or null if current window or frame is to be used.

Returns:
The target="_this" portion of the link to be generated - if any.
Since:
4.0

addEventHandler

void addEventHandler(LinkEventType type,
                     String functionName)
Deprecated. To be removed in Tapestry 4.1.4.

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.

Parameters:
type - The type of event to add.
functionName - The name of the client side javascript function to generate.
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.

Parameters:
cycle - The current request.
Returns:
A ILink instance representing the link information for this component.

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.

Parameters:
writer - Markup writer to write content to.
cycle - The current request.
Since:
3.0


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.