|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.util.html.HTMLTagAttributes
com.ibm.as400.util.html.HTMLHyperlink
public class HTMLHyperlink
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:
Field Summary |
---|
Fields inherited from interface com.ibm.as400.util.html.HTMLConstants |
---|
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 Summary | |
---|---|
HTMLHyperlink()
Creates a default HTMLHyperlink object. |
|
HTMLHyperlink(String link)
Creates an HTMLHyperlink object with the specified resource link. |
|
HTMLHyperlink(String link,
String text)
Creates an HTMLHyperlink object with the specified resource link represented by the specified text. |
|
HTMLHyperlink(String link,
String text,
String target)
Creates an HTMLHyperlink object with the specified resource link and target frame represented by the specified text. |
Method Summary | |
---|---|
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. |
Object |
clone()
Returns a copy of the HTMLHyperlink. |
String |
getDirection()
Returns the direction of the text interpretation. |
String |
getFOTag()
Returns a comment tag. |
String |
getLanguage()
Returns the language of the input element. |
String |
getLink()
Returns the Uniform Resource Identifier (URI) for the resource link. |
String |
getLocation()
Returns the bookmark locatoin of the resource link. |
String |
getName()
Returns the bookmark name. |
Properties |
getProperties()
Returns the properties associated with the link resource. |
String |
getTag()
Returns the HTML tag that represents the resource link. |
String |
getTag(String text,
Properties properties)
Returns the HTML tag that represents the resource link with the specified text and properties. |
String |
getTag(String text,
String name,
String link,
Properties properties)
Returns the HTML tag that represents the resource link with the specified text, bookmark name, resource link, and properties. |
String |
getTarget()
Returns the target frame for the resource link. |
String |
getText()
Returns the text that represents the resource link. |
String |
getTitle()
Returns the title for the resource link. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setDirection(String dir)
Sets the direction of the text interpretation. |
void |
setLanguage(String lang)
Sets the language of the input tag. |
void |
setLink(String link)
Sets the Uniform Resource Identifier (URI) for the resource link. |
void |
setLocation(String location)
Sets the bookmark location of the resource link within a document. |
void |
setName(String name)
Sets the bookmark name. |
void |
setProperties(Properties properties)
Sets the properties associated with the resource link. |
void |
setTarget(String target)
Sets the target frame for the resource link. |
void |
setText(String text)
Sets the text representation for the resource link. |
void |
setTitle(String title)
Sets the title for the resource link. |
String |
toString()
Returns the HTML tag that represents the resource link. |
Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes |
---|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HTMLHyperlink()
public HTMLHyperlink(String link)
link
- The Uniform Resource Identifier (URI).public HTMLHyperlink(String link, String text)
link
- The Uniform Resource Identifier (URI).text
- The text representation for the resource.public HTMLHyperlink(String link, String text, String target)
link
- The Uniform Resource Identifier (URI).text
- The text representation for the resource.target
- The target frame.Method Detail |
---|
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public Object clone()
clone
in class Object
public String getDirection()
public String getLanguage()
public String getLink()
public String getLocation()
public String getName()
public Properties getProperties()
public String getTarget()
HTMLConstants
public String getText()
public String getTitle()
public String getFOTag()
getFOTag
in interface HTMLTagElement
public String getTag()
getTag
in interface HTMLTagElement
public String getTag(String text, Properties properties)
text
- The text.properties
- The Properties.
public String getTag(String text, String name, String link, Properties properties)
text
- The text.name
- The bookmark name.link
- The Uniform Resource Identifier (URI).properties
- The Properties.
public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setDirection(String dir) throws PropertyVetoException
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.
PropertyVetoException
- If a change is vetoed.HTMLConstants
public void setLanguage(String lang) throws PropertyVetoException
lang
- The language. Example language tags include:
en and en-US.
PropertyVetoException
- If a change is vetoed.public void setLocation(String location)
location
- The location.public void setLink(String link) throws PropertyVetoException
link
- The Uniform Resource Identifier.
PropertyVetoException
- If the change is vetoed.public void setName(String name) throws PropertyVetoException
name
- The bookmark name.
PropertyVetoException
- If the change is vetoed.public void setProperties(Properties properties) throws PropertyVetoException
properties
- The properties.
PropertyVetoException
- If the change is vetoed.public void setTarget(String target) throws 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.
PropertyVetoException
- If the change is vetoed.HTMLConstants
public void setText(String text) throws PropertyVetoException
text
- The text.
PropertyVetoException
- If the change is vetoed.public void setTitle(String title) throws PropertyVetoException
title
- The title.
PropertyVetoException
- If the change is vetoed.public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |