public class OrderedList extends HTMLList
This example creates a OrderedList tag:
// Create an OrderedList. OrderedList list = new OrderedList(); // Use large roman numerals when displaying the list items. list.setType(HTMLConstants.LARGE_ROMAN); // Create an OrderedListItem. OrderedListItem listItem = new OrderedListItem(); // Set the data in the list item. listItem.setItemData(new HTMLText("my list item")); // Add the list item to the OrderedList. list.addListItem(listItem); System.out.println(list.toString());
Here is the output of the OrderedList tag:
<ol type="I"> <li>my list item</li> </ol>
Here is the output of the OrderedList tag using XSL Formatting Objects:
<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>
OrderedList objects generate the following events:
Constructor and Description |
---|
OrderedList()
Constructs a default OrderedList object.
|
OrderedList(java.lang.String type)
Constructs a OrderedList object with the specified order labeling type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFOTag()
Returns the XSL-FO tag for the ordered list.
|
int |
getStartingSequenceNumber()
Returns the starting number in the order labeling.
|
java.lang.String |
getTag()
Returns the tag for the ordered list.
|
java.lang.String |
getType()
Returns the type of the order labeling.
|
void |
setStartingSequenceNumber(int start)
Sets the starting number to something other than "1" to use in incrementing the list structure.
|
void |
setType(java.lang.String type)
Sets the order labeling to be used.
|
addList, addListItem, addListItemElementListener, getDirection, getItemCount, getItems, getLanguage, isCompact, isUseFO, removeList, removeListItem, removeListItemElementListener, setCompact, setDirection, setItems, setLanguage, setUseFO, toString
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public OrderedList()
public OrderedList(java.lang.String type)
type
- The order labeling used to display the ordered list. One of the following
constants defined in HTMLConstants: NUMBERS, CAPITALS, LOWER_CASE, LARGE_ROMAN, or SMALL_ROMAN.public int getStartingSequenceNumber()
public java.lang.String getTag()
public java.lang.String getFOTag()
public java.lang.String getType()
public void setType(java.lang.String type)
type
- The order labeling scheme. One of the following constants
defined in HTMLConstants: NUMBERS, CAPITALS, LOWER_CASE, LARGE_ROMAN, or SMALL_ROMAN.HTMLConstants
public void setStartingSequenceNumber(int start)
start
- The ordered list starting number.