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:
- PropertyChangeEvent
- VetoableChangeEvent
-
HTMLHyperlink()
- Creates a default HTMLHyperlink object.
-
HTMLHyperlink(String)
- Creates an HTMLHyperlink object with the specified resource link.
-
HTMLHyperlink(String, String)
- Creates an HTMLHyperlink object with the specified resource link
represented by the specified text.
-
HTMLHyperlink(String, String, String)
- Creates an HTMLHyperlink object with the specified resource link
and target frame represented by the specified text.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a PropertyChangeListener.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds the VetoableChangeListener.
-
getLink()
- Returns the Uniform Resource Identifier (URI) for the resource link.
-
getName()
- Returns the bookmark name.
-
getProperties()
- Returns the properties associated with the link resource.
-
getTag()
- Returns the HTML tag that represents the resource link.
-
getTag(String, Properties)
- Returns the HTML tag that represents the resource link
with the specified text and properties.
-
getTarget()
- Returns the target frame for the resource link.
-
getText()
- Returns the text that represents the resource link.
-
getTitle()
- Returns the title for the resource link.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes the PropertyChangeListener from the internal list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes the VetoableChangeListener from the internal list.
-
setLink(String)
- Sets the Uniform Resource Identifier (URI) for the resource link.
-
setName(String)
- Sets the bookmark name.
-
setProperties(Properties)
- Sets the properties associated with the resource link.
-
setTarget(String)
- Sets the target frame for the resource link.
-
setText(String)
- Sets the text representation for the resource link.
-
setTitle(String)
- Sets the title for the resource link.
-
toString()
- Returns the HTML tag that represents the resource link.
HTMLHyperlink
public HTMLHyperlink()
- Creates a default HTMLHyperlink object.
HTMLHyperlink
public HTMLHyperlink(String link)
- Creates an HTMLHyperlink object with the specified resource link.
- Parameters:
- link - The Uniform Resource Identifier (URI).
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.
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.
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
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
getLink
public String getLink()
- Returns the Uniform Resource Identifier (URI) for the resource link.
- Returns:
- The Uniform Resource Identifier.
getName
public String getName()
- Returns the bookmark name.
- Returns:
- The name.
getProperties
public Properties getProperties()
- Returns the properties associated with the link resource.
- Returns:
- The properties.
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
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.
getTitle
public String getTitle()
- Returns the title for the resource link.
- Returns:
- The title.
getTag
public String getTag()
- Returns the HTML tag that represents the resource link.
- Returns:
- The HTML tag.
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.
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
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
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.
setName
public void setName(String name) throws PropertyVetoException
- Sets the bookmark name.
- Parameters:
- name - The bookmark name.
- Throws: PropertyVetoException
- If the change is vetoed.
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.
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
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.
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.
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