|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tapestry.spec.BaseLocatable
org.apache.tapestry.AbstractComponent
org.apache.tapestry.link.AbstractLinkComponent
public abstract class AbstractLinkComponent
Base class for
implementations of ILinkComponent. Includes a disabled attribute
(that should be bound to a disabled parameter),
an anchor attribute, and a
renderer attribute (that should be bound to a renderer parameter). A default,
shared instance of DefaultLinkRenderer is
used when no specific renderer is provided.
| Constructor Summary | |
|---|---|
AbstractLinkComponent()
|
|
| Method Summary | |
|---|---|
void |
addEventHandler(LinkEventType eventType,
String functionName)
Adds an event handler (typically, from a wrapped component such as a Rollover). |
protected void |
cleanupAfterRender(IRequestCycle cycle)
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)
after the component renders, to clear any parameters back to
null (or 0, or false, or whatever the correct default is). |
protected void |
finishLoad()
Sets the renderer parameter property to its default value DefaultLinkRenderer.SHARED_INSTANCE. |
abstract 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. |
protected ILink |
getLink(IRequestCycle cycle,
String serviceName,
Object[] serviceParameters)
Utility method for subclasses; Gets the named service from the engine and invokes IEngineService.getLink(IRequestCycle, org.apache.tapestry.IComponent, Object[])
on it. |
abstract ILinkRenderer |
getRenderer()
|
abstract 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. |
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Renders the link by delegating to an instance of ILinkRenderer. |
abstract void |
setRenderer(ILinkRenderer renderer)
|
protected String |
writeEventHandler(IMarkupWriter writer,
Body body,
String name,
String attributeName,
Object value)
|
protected void |
writeEventHandlers(IMarkupWriter writer,
IRequestCycle cycle)
|
| Methods inherited from class org.apache.tapestry.spec.BaseLocatable |
|---|
getLocation, setLocation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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 |
| Constructor Detail |
|---|
public AbstractLinkComponent()
| Method Detail |
|---|
public abstract boolean isDisabled()
ILinkComponent
isDisabled in interface ILinkComponent
public void addEventHandler(LinkEventType eventType,
String functionName)
Rollover).
addEventHandler in interface ILinkComponent
protected void renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
ILinkRenderer.
renderComponent in class AbstractComponentprotected void cleanupAfterRender(IRequestCycle cycle)
AbstractComponentAbstractComponent.render(IMarkupWriter, IRequestCycle)
after the component renders, to clear any parameters back to
null (or 0, or false, or whatever the correct default is).
Primarily, this is used to ensure
that the component doesn't hold onto any objects that could
otherwise be garbage collected.
Subclasses may override this implementation, but must also invoke it.
cleanupAfterRender in class AbstractComponent
protected void writeEventHandlers(IMarkupWriter writer,
IRequestCycle cycle)
protected String writeEventHandler(IMarkupWriter writer,
Body body,
String name,
String attributeName,
Object value)
public abstract ILinkRenderer getRenderer()
public abstract void setRenderer(ILinkRenderer renderer)
public void renderAdditionalAttributes(IMarkupWriter writer,
IRequestCycle cycle)
ILinkComponentILinkRenderer)
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.
renderAdditionalAttributes in interface ILinkComponent
protected ILink getLink(IRequestCycle cycle,
String serviceName,
Object[] serviceParameters)
IEngineService.getLink(IRequestCycle, org.apache.tapestry.IComponent, Object[])
on it.
public abstract String getAnchor()
ILinkComponent
getAnchor in interface ILinkComponentpublic ILink getLink(IRequestCycle cycle)
ILinkComponentILinkRenderer (if
the link is not disabled) to provide a
EngineServiceLink that the renderer can convert
into a URL.
getLink in interface ILinkComponentprotected void finishLoad()
DefaultLinkRenderer.SHARED_INSTANCE.
finishLoad in class AbstractComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||