|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.util.html.HTMLTagAttributes | +--com.ibm.as400.util.html.HTMLText
The HTMLText class encapsulates HTML text attributes.
This example creates an HTMLText object and sets its attributes.
Here is the output of the tag:HTMLText text = new HTMLText("IBM"); text.setBold(true); text.setSize(3); System.out.println(text.getTag());
<font size="3"><b>IBM</b></font>
HTMLText objects generate the following events:
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 | |
HTMLText()
Constructs a default HTMLText object. |
|
HTMLText(java.lang.String text)
Constructs an HTMLText object with the specified text. |
Method Summary | |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds the VetoableChangeListener. |
java.lang.String |
getAlignment()
Returns the horizontal alignment. |
java.awt.Color |
getColor()
Returns the color used to paint the text. |
java.lang.String |
getDirection()
Returns the direction of the text interpretation. |
java.lang.String |
getLanguage()
Returns the language of the text element. |
int |
getSize()
Returns the font text size. |
java.lang.String |
getTag()
Returns the text tag. |
java.lang.String |
getTag(boolean useAlignment)
Returns the text tag. |
java.lang.String |
getTag(java.lang.String text)
Returns the text tag with the specified text. |
java.lang.String |
getTag(java.lang.String text,
boolean useAlignment)
Returns the text tag with the specified text. |
java.lang.String |
getText()
Returns the text. |
boolean |
isBold()
Indicates if bold is on. |
boolean |
isFixed()
Indicates if fixed pitch font is on. |
boolean |
isItalic()
Indicates if italic is on. |
boolean |
isUnderscore()
Indicates if underline is on. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setAlignment(java.lang.String alignment)
Sets the horizontal alignment. |
void |
setBold(boolean bold)
Sets bold on or off. |
void |
setColor(java.awt.Color color)
Sets the color used to paint the text. |
void |
setDirection(java.lang.String dir)
Sets the direction of the text interpretation. |
void |
setFixed(boolean fixed)
Sets fixed pitch font on or off. |
void |
setItalic(boolean italic)
Sets italic on or off. |
void |
setLanguage(java.lang.String lang)
Sets the language of the text tag. |
void |
setSize(int size)
Sets the text font size. |
void |
setText(java.lang.String text)
Sets the text. |
void |
setUnderscore(boolean underscore)
Sets underline on or off. |
java.lang.String |
toString()
Returns the HTML text tag. |
Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes |
addPropertyChangeListener,
getAttributes,
getAttributeString,
removePropertyChangeListener,
setAttributes |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public HTMLText()
public HTMLText(java.lang.String text)
text
- The text.Method Detail |
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public java.lang.String getAlignment()
HTMLConstants
public java.awt.Color getColor()
public java.lang.String getDirection()
public java.lang.String getLanguage()
public int getSize()
public java.lang.String getTag()
public java.lang.String getTag(boolean useAlignment)
useAlignment
- true if the alignment tag should be included; false otherwise.public java.lang.String getTag(java.lang.String text)
text
- The text.public java.lang.String getTag(java.lang.String text, boolean useAlignment)
text
- The text.useAlignment
- true if the alignment tag should be included; false otherwise.public java.lang.String getText()
public boolean isBold()
public boolean isFixed()
public boolean isItalic()
public boolean isUnderscore()
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setAlignment(java.lang.String alignment) throws java.beans.PropertyVetoException
alignment
- The horizontal alignment. One of the following constants
defined in HTMLConstants: LEFT, CENTER, RIGHT, or JUSTIFY.HTMLConstants
public void setBold(boolean bold) throws java.beans.PropertyVetoException
bold
- true if on, false if off.public void setColor(java.awt.Color color) throws java.beans.PropertyVetoException
color
- The Color object.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.HTMLConstants
public void setFixed(boolean fixed) throws java.beans.PropertyVetoException
fixed
- true if on, false if off.public void setItalic(boolean italic) throws java.beans.PropertyVetoException
italic
- true if on, false if off.public void setLanguage(java.lang.String lang) throws java.beans.PropertyVetoException
lang
- The language. Example language tags include:
en and en-US.public void setSize(int size) throws java.beans.PropertyVetoException
size
- The font size.public void setText(java.lang.String text) throws java.beans.PropertyVetoException
text
- The text.public void setUnderscore(boolean underscore) throws java.beans.PropertyVetoException
underscore
- true if on, false if off.public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |