public class HTMLAlign extends HTMLTagAttributes implements java.io.Serializable
This example creates a HTMLAlign tag:
// Create an ordered list. OrderedList list = new OrderedList(HTMLConstants.LARGE_ROMAN); OrderedListItem listItem = new OrderedListItem(); listItem.setItemData(new HTMLText("my list item")); list.addListItem(listItem); // Align the list. HTMLAlign align = new HTMLAlign(list, HTMLConstants.CENTER); System.out.println(align);
Here is the output of the HTMLAlign tag:
<div align="center"> <ol type="I"> <li type="i">my list item</li> </ol> </div>
Calling getFOTag() would produce the following:
<fo:block text-align='center'> <fo:block-container> <fo:list-block> <fo:list-item> <fo:list-item-label>I.</fo:list-item-label> <fo:list-item-body><fo:block-container><fo:block>my list item</fo:block> </fo:block-container> </fo:list-item-body> </fo:list-item> </fo:list-block> </fo:block-container> </fo:block>
HTMLAlign objects generate the following events:
Constructor and Description |
---|
HTMLAlign()
Constructs a default HTMLAlign object.
|
HTMLAlign(HTMLTagElement data)
Constructs an HTMLAlign object with the specified data.
|
HTMLAlign(HTMLTagElement data,
java.lang.String align)
Constructs an HTMLAlign object with the specified data and align attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(HTMLTagElement data)
Adds an HTMLTagElement to the list of tags to align.
|
void |
addItemElementListener(ElementListener listener)
Adds an ElementListener.
|
java.lang.String |
getAlign()
Returns the alignment of the HTMLAlign object.
|
java.lang.String |
getDirection()
Returns the direction of the text interpretation.
|
java.lang.String |
getFOTag()
Returns the tag for the XSL-FO alignment.
|
java.lang.String |
getLanguage()
Returns the language of the input element.
|
java.lang.String |
getTag()
Returns the tag for the HTML alignment.
|
boolean |
isUseFO()
Returns if Formatting Object tags are outputted.
|
void |
removeItem(HTMLTagElement data)
Removes an HTMLTagElement from the list of tags to align.
|
void |
removeItemElementListener(ElementListener listener)
Removes this ElementListener.
|
void |
setAlign(java.lang.String align)
Sets the horizontal alignment for a block of HTML.
|
void |
setDirection(java.lang.String dir)
Sets the direction of the text interpretation.
|
void |
setLanguage(java.lang.String lang)
Sets the language of the HTMLAlign tag.
|
void |
setUseFO(boolean useFO)
Sets if Formatting Object tags should be used.
|
java.lang.String |
toString()
Returns a String representation for the HTMLAlign tag.
|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public HTMLAlign()
public HTMLAlign(HTMLTagElement data)
data
- The data to align.public HTMLAlign(HTMLTagElement data, java.lang.String align)
data
- The data to align.align
- The type of alignment. One of the following constants
defined in HTMLConstants: LEFT, RIGHT, or CENTER.public void addItem(HTMLTagElement data)
data
- The data to align.public void addItemElementListener(ElementListener listener)
listener
- The ElementListener.public java.lang.String getAlign()
public java.lang.String getDirection()
public java.lang.String getLanguage()
public java.lang.String getTag()
getTag
in interface HTMLTagElement
public java.lang.String getFOTag()
getFOTag
in interface HTMLTagElement
public void removeItemElementListener(ElementListener listener)
listener
- The ElementListener.public boolean isUseFO()
public void removeItem(HTMLTagElement data)
data
- The data to remove.public void setAlign(java.lang.String align)
align
- The alignment. One of the following constants
defined in HTMLConstants: LEFT, RIGHT, or CENTER.HTMLConstants
public void setDirection(java.lang.String dir)
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.HTMLConstants
public void setLanguage(java.lang.String lang)
lang
- The language. Example language tags include:
en and en-US.public void setUseFO(boolean useFO)
useFO
- - true if output generated is an XSL formatting object, false if the output generated is HTML.public java.lang.String toString()
toString
in class java.lang.Object