All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.util.html.HTMLHyperlink

java.lang.Object
   |
   +----com.ibm.as400.util.html.HTMLHyperlink

public class HTMLHyperlink
extends Object
implements HTMLTagElement, HTMLConstants, Serializable
The HTMLHyperlink class represents an HTML hyperlink tag.

This example creates an HTMLHyperlink and displays the HTML tag.

  HTMLHyperlink link = new HTMLHyperlink("http://www.myCompany.com", "myCompany Home Page");
  System.out.println(link.getTag());
  

Here is the output of the HTMLHyperlink:

  <a href="http://www.myCompany.com">myCompany Home Page</a>
  

This example creates an HTMLHyperlink and sets two properties.

  HTMLHyperlink link = new HTMLHyperlink("http://www.myCompany.com", "myCompany Home Page");
  Properties properties = new Properties();
  properties.put("userID", "fred");
  properties.put("employeeID", "01234567");
  link.setProperties(properties);
  System.out.println(link.getTag());
  

Here is the output of the HTMLHyperlink:

  <a href="http://www.myCompany.com?userid=fred&employeeID=01234567">myCompany Home Page</a>
  

HTMLHyperlink objects generate the following events:


Constructor Index

 o HTMLHyperlink()
Creates a default HTMLHyperlink object.
 o HTMLHyperlink(String)
Creates an HTMLHyperlink object with the specified resource link.
 o HTMLHyperlink(String, String)
Creates an HTMLHyperlink object with the specified resource link represented by the specified text.
 o HTMLHyperlink(String, String, String)
Creates an HTMLHyperlink object with the specified resource link and target frame represented by the specified text.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a PropertyChangeListener.
 o addVetoableChangeListener(VetoableChangeListener)
Adds the VetoableChangeListener.
 o getLink()
Returns the Uniform Resource Identifier (URI) for the resource link.
 o getName()
Returns the bookmark name.
 o getProperties()
Returns the properties associated with the link resource.
 o getTag()
Returns the HTML tag that represents the resource link.
 o getTag(String, Properties)
Returns the HTML tag that represents the resource link with the specified text and properties.
 o getTarget()
Returns the target frame for the resource link.
 o getText()
Returns the text that represents the resource link.
 o getTitle()
Returns the title for the resource link.
 o removePropertyChangeListener(PropertyChangeListener)
Removes the PropertyChangeListener from the internal list.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes the VetoableChangeListener from the internal list.
 o setLink(String)
Sets the Uniform Resource Identifier (URI) for the resource link.
 o setName(String)
Sets the bookmark name.
 o setProperties(Properties)
Sets the properties associated with the resource link.
 o setTarget(String)
Sets the target frame for the resource link.
 o setText(String)
Sets the text representation for the resource link.
 o setTitle(String)
Sets the title for the resource link.
 o toString()
Returns the HTML tag that represents the resource link.

Constructors

 o HTMLHyperlink
 public HTMLHyperlink()
Creates a default HTMLHyperlink object.

 o HTMLHyperlink
 public HTMLHyperlink(String link)
Creates an HTMLHyperlink object with the specified resource link.

Parameters:
link - The Uniform Resource Identifier (URI).
 o HTMLHyperlink
 public HTMLHyperlink(String link,
                      String text)
Creates an HTMLHyperlink object with the specified resource link represented by the specified text.

Parameters:
link - The Uniform Resource Identifier (URI).
text - The text representation for the resource.
 o HTMLHyperlink
 public HTMLHyperlink(String link,
                      String text,
                      String target)
Creates an HTMLHyperlink object with the specified resource link and target frame represented by the specified text.

Parameters:
link - The Uniform Resource Identifier (URI).
text - The text representation for the resource.
target - The target frame.

Methods

 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method is called each time the value of any bound property is changed.

Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. The specified VetoableChangeListener's vetoableChange method is called each time the value of any constrained property is changed.

Parameters:
listener - The VetoableChangeListener.
See Also:
removeVetoableChangeListener
 o getLink
 public String getLink()
Returns the Uniform Resource Identifier (URI) for the resource link.

Returns:
The Uniform Resource Identifier.
 o getName
 public String getName()
Returns the bookmark name.

Returns:
The name.
 o getProperties
 public Properties getProperties()
Returns the properties associated with the link resource.

Returns:
The properties.
 o getTarget
 public String getTarget()
Returns the target frame for the resource link.

Returns:
The target frame. a user-defined frame or one of the following constants defined in HTMLConstants: TARGET_BLANK, TARGET_PARENT, TARGET_SELF, or TARGET_TOP.
See Also:
HTMLConstants
 o getText
 public String getText()
Returns the text that represents the resource link. This the text that is shown in the HTML document.

Returns:
The text.
 o getTitle
 public String getTitle()
Returns the title for the resource link.

Returns:
The title.
 o getTag
 public String getTag()
Returns the HTML tag that represents the resource link.

Returns:
The HTML tag.
 o getTag
 public String getTag(String text,
                      Properties properties)
Returns the HTML tag that represents the resource link with the specified text and properties. The original HTMLHyperlink object text and properties are not changed/updated.

Parameters:
text - The text.
properties - The Properties.
Returns:
The HTML tag.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. If the PropertyChangeListener is not on the list, nothing is done.

Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. If the VetoableChangeListener is not on the list, nothing is done.

Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener
 o setLink
 public void setLink(String link) throws PropertyVetoException
Sets the Uniform Resource Identifier (URI) for the resource link.

Parameters:
link - The Uniform Resource Identifier.
Throws: PropertyVetoException
If the change is vetoed.
 o setName
 public void setName(String name) throws PropertyVetoException
Sets the bookmark name.

Parameters:
name - The bookmark name.
Throws: PropertyVetoException
If the change is vetoed.
 o setProperties
 public void setProperties(Properties properties) throws PropertyVetoException
Sets the properties associated with the resource link. The properties are the attributes associated with the Uniform Resource Identifier.

Parameters:
properties - The properties.
Throws: PropertyVetoException
If the change is vetoed.
 o setTarget
 public void setTarget(String target) throws PropertyVetoException
Sets the target frame for the resource link.

Parameters:
target - The target frame. A user-defined frame or one of the following constants defined in HTMLConstants: TARGET_BLANK, TARGET_PARENT, TARGET_SELF, or TARGET_TOP.
Throws: PropertyVetoException
If the change is vetoed.
See Also:
HTMLConstants
 o setText
 public void setText(String text) throws PropertyVetoException
Sets the text representation for the resource link. This is the text that is shown in the HTML document.

Parameters:
text - The text.
Throws: PropertyVetoException
If the change is vetoed.
 o setTitle
 public void setTitle(String title) throws PropertyVetoException
Sets the title for the resource link.

Parameters:
title - The title.
Throws: PropertyVetoException
If the change is vetoed.
 o toString
 public String toString()
Returns the HTML tag that represents the resource link.

Returns:
The HTML tag.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index