public class HTMLHyperlink extends HTMLTagAttributes implements HTMLConstants, java.io.Serializable
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:
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CAPITALS, CENTER, CIRCLE, DISC, JUSTIFY, LARGE_ROMAN, LEFT, LOWER_CASE, LTR, MIDDLE, NUMBERS, RIGHT, RTL, SMALL_ROMAN, SQUARE, TARGET_BLANK, TARGET_PARENT, TARGET_SELF, TARGET_TOP, TEXTTOP, TOP
Constructor and Description |
---|
HTMLHyperlink()
Creates a default HTMLHyperlink object.
|
HTMLHyperlink(java.lang.String link)
Creates an HTMLHyperlink object with the specified resource link.
|
HTMLHyperlink(java.lang.String link,
java.lang.String text)
Creates an HTMLHyperlink object with the specified resource link
represented by the specified text.
|
HTMLHyperlink(java.lang.String link,
java.lang.String text,
java.lang.String target)
Creates an HTMLHyperlink object with the specified resource link
and target frame represented by the specified text.
|
Modifier and Type | Method and Description |
---|---|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds the VetoableChangeListener.
|
java.lang.Object |
clone()
Returns a copy of the HTMLHyperlink.
|
java.lang.String |
getDirection()
Returns the direction of the text interpretation.
|
java.lang.String |
getFOTag()
Returns a comment tag.
|
java.lang.String |
getLanguage()
Returns the language of the input element.
|
java.lang.String |
getLink()
Returns the Uniform Resource Identifier (URI) for the resource link.
|
java.lang.String |
getLocation()
Returns the bookmark locatoin of the resource link.
|
java.lang.String |
getName()
Returns the bookmark name.
|
java.util.Properties |
getProperties()
Returns the properties associated with the link resource.
|
java.lang.String |
getTag()
Returns the HTML tag that represents the resource link.
|
java.lang.String |
getTag(java.lang.String text,
java.util.Properties properties)
Returns the HTML tag that represents the resource link
with the specified text and properties.
|
java.lang.String |
getTag(java.lang.String text,
java.lang.String name,
java.lang.String link,
java.util.Properties properties)
Returns the HTML tag that represents the resource link
with the specified text, bookmark name, resource link, and properties.
|
java.lang.String |
getTarget()
Returns the target frame for the resource link.
|
java.lang.String |
getText()
Returns the text that represents the resource link.
|
java.lang.String |
getTitle()
Returns the title for the resource link.
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list.
|
void |
setDirection(java.lang.String dir)
Sets the direction of the text interpretation.
|
void |
setLanguage(java.lang.String lang)
Sets the language of the input tag.
|
void |
setLink(java.lang.String link)
Sets the Uniform Resource Identifier (URI) for the resource link.
|
void |
setLocation(java.lang.String location)
Sets the bookmark location of the resource link within a document.
|
void |
setName(java.lang.String name)
Sets the bookmark name.
|
void |
setProperties(java.util.Properties properties)
Sets the properties associated with the resource link.
|
void |
setTarget(java.lang.String target)
Sets the target frame for the resource link.
|
void |
setText(java.lang.String text)
Sets the text representation for the resource link.
|
void |
setTitle(java.lang.String title)
Sets the title for the resource link.
|
java.lang.String |
toString()
Returns the HTML tag that represents the resource link.
|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public HTMLHyperlink()
public HTMLHyperlink(java.lang.String link)
link
- The Uniform Resource Identifier (URI).public HTMLHyperlink(java.lang.String link, java.lang.String text)
link
- The Uniform Resource Identifier (URI).text
- The text representation for the resource.public HTMLHyperlink(java.lang.String link, java.lang.String text, java.lang.String target)
link
- The Uniform Resource Identifier (URI).text
- The text representation for the resource.target
- The target frame.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getDirection()
public java.lang.String getLanguage()
public java.lang.String getLink()
public java.lang.String getLocation()
public java.lang.String getName()
public java.util.Properties getProperties()
public java.lang.String getTarget()
HTMLConstants
public java.lang.String getText()
public java.lang.String getTitle()
public java.lang.String getFOTag()
getFOTag
in interface HTMLTagElement
public java.lang.String getTag()
getTag
in interface HTMLTagElement
public java.lang.String getTag(java.lang.String text, java.util.Properties properties)
text
- The text.properties
- The Properties.public java.lang.String getTag(java.lang.String text, java.lang.String name, java.lang.String link, java.util.Properties properties)
text
- The text.name
- The bookmark name.link
- The Uniform Resource Identifier (URI).properties
- The Properties.public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setDirection(java.lang.String dir) throws java.beans.PropertyVetoException
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.java.beans.PropertyVetoException
- If a change is vetoed.HTMLConstants
public void setLanguage(java.lang.String lang) throws java.beans.PropertyVetoException
lang
- The language. Example language tags include:
en and en-US.java.beans.PropertyVetoException
- If a change is vetoed.public void setLocation(java.lang.String location)
location
- The location.public void setLink(java.lang.String link) throws java.beans.PropertyVetoException
link
- The Uniform Resource Identifier.java.beans.PropertyVetoException
- If the change is vetoed.public void setName(java.lang.String name) throws java.beans.PropertyVetoException
name
- The bookmark name.java.beans.PropertyVetoException
- If the change is vetoed.public void setProperties(java.util.Properties properties) throws java.beans.PropertyVetoException
properties
- The properties.java.beans.PropertyVetoException
- If the change is vetoed.public void setTarget(java.lang.String target) throws java.beans.PropertyVetoException
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.java.beans.PropertyVetoException
- If the change is vetoed.HTMLConstants
public void setText(java.lang.String text) throws java.beans.PropertyVetoException
text
- The text.java.beans.PropertyVetoException
- If the change is vetoed.public void setTitle(java.lang.String title) throws java.beans.PropertyVetoException
title
- The title.java.beans.PropertyVetoException
- If the change is vetoed.public java.lang.String toString()
toString
in class java.lang.Object