Class AbstractLink
java.lang.Object
org.apache.tapestry5.corelib.base.AbstractLink
- All Implemented Interfaces:
ClientElement
- Direct Known Subclasses:
AbstractComponentEventLink
,PageLink
@SupportsInformalParameters
public abstract class AbstractLink
extends Object
implements ClientElement
Provides base utilities for classes that generate clickable links.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addParameters
(Link link) Adds any user-defined parameters as query parameters.final String
Returns the unique client id for this element.getLink()
Returns the most recently renderedLink
for this component.boolean
Returns true if the component is disabled (as per its disabled parameter).protected final void
writeLink
(MarkupWriter writer, Link link, Object... namesAndValues) Writes an <a> element with the provided link as the href attribute.
-
Field Details
-
resources
-
-
Constructor Details
-
AbstractLink
public AbstractLink()
-
-
Method Details
-
writeLink
Writes an <a> element with the provided link as the href attribute. A call toMarkupWriter.end()
is not provided. Automatically appends an anchor if the component's anchor parameter is non-null. Informal parameters are rendered as well.- Parameters:
writer
- to write markup tolink
- the link that will form the hrefnamesAndValues
- additional attributes to write
-
addParameters
Adds any user-defined parameters as query parameters.- Parameters:
link
- aLink
.
-
getLink
Returns the most recently renderedLink
for this component. Subclasses calculate their link value as they render, and the value is valid until the end of the request, or the next time the same component renders itself (if inside a loop).- Returns:
- the most recent link, or null
-
getClientId
Returns the unique client id for this element. This is valid only after the component has rendered (its start tag). A client id is generated the first time this method is invoked, after the link renders its start tag.- Specified by:
getClientId
in interfaceClientElement
- Returns:
- a unique id for the element. This value will be unique for any given rendering of a page. This value is intended for use as the id attribute of the client-side element, and will be used with any DHTML/Ajax related JavaScript.
-
isDisabled
Returns true if the component is disabled (as per its disabled parameter). Disabled link components should not render a tag, but should still render their body.- Returns:
true
orfalse
.
-