net.sf.click.extras.control
Class ExternalLink

java.lang.Object
  extended bynet.sf.click.control.AbstractControl
      extended bynet.sf.click.control.AbstractLink
          extended bynet.sf.click.extras.control.ExternalLink
All Implemented Interfaces:
Control, Serializable

public class ExternalLink
extends AbstractLink

Provides an External Link control:   <a href="" ></a>.

External Link
The ExternalLink control is used to create links to external pages and resources. See also the W3C HTML reference: A Links

Author:
Malcolm Edgar
See Also:
Serialized Form

Field Summary
protected  String targetPath
          The target path.
 
Fields inherited from class net.sf.click.control.AbstractLink
disabled, imageSrc, label, parameters, tabindex, title
 
Fields inherited from class net.sf.click.control.AbstractControl
actionListener, attributes, listener, listenerMethod, messages, name, parent, styles
 
Fields inherited from interface net.sf.click.Control
CONTROL_MESSAGES
 
Constructor Summary
ExternalLink()
          Create an ExternalLink with no name defined.
ExternalLink(String name)
          Create an ExternalLink for the given name.
ExternalLink(String name, String targetPath)
          Create an ExternalLink for the given name and target Page class.
 
Method Summary
 String getHref()
          Return the ExternalLink anchor <a> tag href attribute.
 String getTargetPath()
          Return the link href target path.
 boolean onProcess()
          This method will return true.
 void setListener(Object listener, String method)
          This method does nothing.
 void setTargetPath(String targetPath)
          Set the link href target path.
 
Methods inherited from class net.sf.click.control.AbstractLink
getHtmlImports, getId, getImageSrc, getLabel, getParameter, getParameters, getTabIndex, getTag, getTitle, hasParameters, isDisabled, render, setDisabled, setImageSrc, setLabel, setParameter, setTabIndex, setTitle
 
Methods inherited from class net.sf.click.control.AbstractControl
addStyleClass, appendAttributes, getActionListener, getAttribute, getAttributes, getContext, getControlSizeEst, getMessage, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, hasAttribute, hasAttributes, hasStyles, onDeploy, onDestroy, onInit, onRender, registerActionEvent, removeStyleClass, renderTagBegin, renderTagEnd, setActionListener, setAttribute, setId, setName, setParent, setStyle, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

targetPath

protected String targetPath
The target path.

Constructor Detail

ExternalLink

public ExternalLink(String name)
Create an ExternalLink for the given name.

Parameters:
name - the page link name
Throws:
IllegalArgumentException - if the name is null

ExternalLink

public ExternalLink(String name,
                    String targetPath)
Create an ExternalLink for the given name and target Page class.

Parameters:
name - the page link name
targetPath - the href target path
Throws:
IllegalArgumentException - if the name is null

ExternalLink

public ExternalLink()
Create an ExternalLink with no name defined.

Please note the control's name and target path must be defined before it is valid.

Method Detail

getHref

public String getHref()
Return the ExternalLink anchor <a> tag href attribute. This method will encode the URL with the session ID if required using HttpServletResponse.encodeURL().

Returns:
the ExternalLink HTML href attribute

setListener

public void setListener(Object listener,
                        String method)
This method does nothing.

Parameters:
listener - the listener object with the named method to invoke
method - the name of the method to invoke
See Also:
Control.setListener(Object, String)

getTargetPath

public String getTargetPath()
Return the link href target path.

Returns:
the link href target path

setTargetPath

public void setTargetPath(String targetPath)
Set the link href target path.

Parameters:
targetPath - the link href target path

onProcess

public boolean onProcess()
This method will return true.

Returns:
true
See Also:
Control.onProcess()