|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.util.html.HTMLTagAttributes
com.ibm.as400.util.html.HTMLText
public class HTMLText extends HTMLTagAttributes implements HTMLConstants, Serializable
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>
Here is the output of calling getFOTag():
<fo:block font-size='9pt' font-weight='bold'>IBM</fo:block>
HTMLText objects generate the following events:
Modifier and Type | Field and Description |
---|
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 and Description |
---|
HTMLText()
Constructs a default HTMLText object. |
HTMLText(String text)
Constructs an HTMLText object with the specified text. |
Modifier and Type | Method and Description |
---|---|
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. |
String |
getAlignment()
Returns the horizontal alignment. |
Color |
getColor()
Returns the color used to paint the text. |
String |
getDirection()
Returns the direction of the text interpretation. |
String |
getFOTag()
Returns the XSL-FO text tag. |
String |
getFOTag(boolean useAlignment)
Returns the XSL-FO text tag. |
String |
getFOTag(String text)
Returns the XSL-FO text tag with the specified text. |
String |
getFOTag(String text,
boolean useAlignment)
Returns the XSL-FO text tag with the specified text. |
String |
getLanguage()
Returns the language of the text element. |
int |
getSize()
Returns the font text size. |
String |
getTag()
Returns the text tag. |
String |
getTag(boolean useAlignment)
Returns the text tag. |
String |
getTag(String text)
Returns the text tag with the specified text. |
String |
getTag(String text,
boolean useAlignment)
Returns the text tag with the specified text. |
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. |
boolean |
isUseFO()
Returns if Formatting Object tags are outputted. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setAlignment(String alignment)
Sets the horizontal alignment. |
void |
setBold(boolean bold)
Sets bold on or off. |
void |
setColor(Color color)
Sets the color used to paint the text. |
void |
setDirection(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(String lang)
Sets the language of the text tag. |
void |
setSize(int size)
Sets the text font size. |
void |
setText(String text)
Sets the text. |
void |
setUnderscore(boolean underscore)
Sets underline on or off. |
void |
setUseFO(boolean useFO)
Sets if Formatting Object tags should be used. |
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(String text)
text
- The text.Method Detail |
---|
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public String getAlignment()
HTMLConstants
public Color getColor()
public String getDirection()
public String getLanguage()
public int getSize()
public String getTag()
getTag
in interface HTMLTagElement
public String getFOTag()
getFOTag
in interface HTMLTagElement
public String getTag(boolean useAlignment)
useAlignment
- true if the alignment tag should be included; false otherwise.public String getFOTag(boolean useAlignment)
useAlignment
- true if the alignment tag should be included; false otherwise.public String getTag(String text)
text
- The text.public String getFOTag(String text)
text
- The text.public String getTag(String text, boolean useAlignment)
text
- The text.useAlignment
- true if the alignment tag should be included; false otherwise.public String getFOTag(String text, boolean useAlignment)
text
- The text.useAlignment
- true if the alignment tag should be included; false otherwise.public String getText()
public boolean isBold()
public boolean isFixed()
public boolean isItalic()
public boolean isUnderscore()
public boolean isUseFO()
public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setAlignment(String alignment) throws PropertyVetoException
alignment
- The horizontal alignment. One of the following constants
defined in HTMLConstants: LEFT, CENTER, RIGHT, or JUSTIFY.PropertyVetoException
- If the change is vetoed.HTMLConstants
public void setBold(boolean bold) throws PropertyVetoException
bold
- true if on, false if off.PropertyVetoException
- If the change is vetoed.public void setColor(Color color) throws PropertyVetoException
color
- The Color object.PropertyVetoException
- If the change is vetoed.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 setFixed(boolean fixed) throws PropertyVetoException
fixed
- true if on, false if off.PropertyVetoException
- If the change is vetoed.public void setItalic(boolean italic) throws PropertyVetoException
italic
- true if on, false if off.PropertyVetoException
- If the change is vetoed.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 setSize(int size) throws PropertyVetoException
size
- The font size.PropertyVetoException
- If the change is vetoed.public void setText(String text) throws PropertyVetoException
text
- The text.PropertyVetoException
- If the change is vetoed.public void setUnderscore(boolean underscore) throws PropertyVetoException
underscore
- true if on, false if off.PropertyVetoException
- If the change is vetoed.public void setUseFO(boolean useFO)
useFO
- - true if output generated is an XSL formatting object, false if the output generated is HTML.public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |