org.odftoolkit.odfdom.incubator.doc.text
Class OdfTextListStyle

java.lang.Object
  extended by org.apache.xerces.dom.NodeImpl
      extended by org.apache.xerces.dom.ChildNode
          extended by org.apache.xerces.dom.ParentNode
              extended by org.apache.xerces.dom.ElementImpl
                  extended by org.apache.xerces.dom.ElementNSImpl
                      extended by org.odftoolkit.odfdom.pkg.OdfElement
                          extended by org.odftoolkit.odfdom.pkg.OdfContainerElementBase
                              extended by org.odftoolkit.odfdom.dom.element.OdfStyleBase
                                  extended by org.odftoolkit.odfdom.dom.element.text.TextListStyleElement
                                      extended by org.odftoolkit.odfdom.incubator.doc.text.OdfTextListStyle
All Implemented Interfaces:
Serializable, Cloneable, Comparable, OdfStylePropertySet, Element, EventTarget, Node, NodeList, TypeInfo

public class OdfTextListStyle
extends TextListStyleElement

Convenient functionalty for the parent ODF OpenDocument element List styles require a lot of code to create one level at a time. This class contains constructors that create an entire OdfListStyle based on a delimited string or an array of strings. Each item in the string (or array) represents a list level style for levels 1-10.

If an item contains 1, I, i, A, or a, then it is presumed to be a numbering style; otherwise it is a bulleted style.

See Also:
Serialized Form

Field Summary
protected static int MAX_LIST_LEVEL
          Maximum number of levels in a list.
static boolean SHOW_ALL_LEVELS
          List should show all levels of numbering.
static boolean SHOW_ONE_LEVEL
          List should show only one level of numbering.
 
Fields inherited from class org.odftoolkit.odfdom.dom.element.text.TextListStyleElement
ELEMENT_NAME
 
Fields inherited from class org.odftoolkit.odfdom.pkg.OdfContainerElementBase
mPackageDocument
 
Fields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURI
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.w3c.dom.TypeInfo
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION
 
Constructor Summary
OdfTextListStyle(OdfFileDom ownerDoc)
           
OdfTextListStyle(OdfFileDom ownerDoc, String name, String[] specArray, String spacing, boolean showAllLevels)
          Constructor for OdfEasyListStyle.
OdfTextListStyle(OdfFileDom ownerDoc, String name, String specifiers, String delim, String spacing, boolean showAllLevels)
          Creates an OdfListStyle.
 
Method Summary
 OdfStyleFamily getFamily()
           
 TextListLevelStyleElementBase getLevel(int level)
          returns the given level or null if it does not exist
 TextListLevelStyleElementBase getOrCreateListLevel(int level, Class clazz)
          always returns the given level with the given class.
 OdfStyleBase getParentStyle()
           
 
Methods inherited from class org.odftoolkit.odfdom.dom.element.text.TextListStyleElement
accept, getOdfName, getStyleDisplayNameAttribute, getStyleNameAttribute, getTextConsecutiveNumberingAttribute, newTextListLevelStyleBulletElement, newTextListLevelStyleImageElement, newTextListLevelStyleNumberElement, setStyleDisplayNameAttribute, setStyleNameAttribute, setTextConsecutiveNumberingAttribute
 
Methods inherited from class org.odftoolkit.odfdom.dom.element.OdfStyleBase
addStyleUser, compareTo, equals, getFamilyName, getOrCreatePropertiesElement, getProperties, getPropertiesElement, getProperty, getStrictProperties, getStyleProperties, getStylePropertiesDeep, getStyleUserCount, getStyleUsers, hashCode, hasProperty, onOdfNodeInserted, onOdfNodeRemoved, removeProperty, removeStyleUser, setProperties, setProperty
 
Methods inherited from class org.odftoolkit.odfdom.pkg.OdfContainerElementBase
insertBefore, removeChild, replaceChild
 
Methods inherited from class org.odftoolkit.odfdom.pkg.OdfElement
cloneNode, cloneOdfElement, findFirstChildNode, findNextChildNode, findPreviousChildNode, getAncestorAs, getOdfAttribute, getOdfAttribute, getOdfAttributeValue, getParentAs, hasOdfAttribute, onInsertNode, onInsertNode, onRemoveNode, onRemoveNode, setOdfAttribute, setOdfAttributeValue, toString
 
Methods inherited from class org.apache.xerces.dom.ElementNSImpl
getBaseURI, getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, isDerivedFrom, setPrefix, setType, setValues
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, getUserDataRecord, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, compareDocumentPosition, getChildNodes, getFeature, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, hasChildNodes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setNodeValue, setTextContent, setUserData
 

Field Detail

MAX_LIST_LEVEL

protected static final int MAX_LIST_LEVEL
Maximum number of levels in a list.

See Also:
Constant Field Values

SHOW_ALL_LEVELS

public static final boolean SHOW_ALL_LEVELS
List should show all levels of numbering.

See Also:
Constant Field Values

SHOW_ONE_LEVEL

public static final boolean SHOW_ONE_LEVEL
List should show only one level of numbering.

See Also:
Constant Field Values
Constructor Detail

OdfTextListStyle

public OdfTextListStyle(OdfFileDom ownerDoc)

OdfTextListStyle

public OdfTextListStyle(OdfFileDom ownerDoc,
                        String name,
                        String specifiers,
                        String delim,
                        String spacing,
                        boolean showAllLevels)
Creates an OdfListStyle.

Parameters:
ownerDoc - the document that this list style belongs to.
name - the name of this list style.
specifiers - the string of level specifiers.
delim - the delimiter for splitting the string into levels.
spacing - a css "length" telling how far to indent each level; also min. label width
showAllLevels - true if you want to display all levels of numbering, false otherwise.

OdfTextListStyle

public OdfTextListStyle(OdfFileDom ownerDoc,
                        String name,
                        String[] specArray,
                        String spacing,
                        boolean showAllLevels)
Constructor for OdfEasyListStyle.

Parameters:
ownerDoc - the document that this list style belongs to.
name - the name of this list style.
specArray - an array of strings of level specifications.
spacing - a css "length" telling how far to indent each level; also min. label width
showAllLevels - true if you want to display all levels of numbering, false otherwise.
Method Detail

getLevel

public TextListLevelStyleElementBase getLevel(int level)
returns the given level or null if it does not exist

Parameters:
level - is the level number that should be returned
Returns:
an instance of TextListLevelStyleImageElement, TextListLevelStyleBulletElement, TextListLevelStyleNumberElement or null.

getOrCreateListLevel

public TextListLevelStyleElementBase getOrCreateListLevel(int level,
                                                          Class clazz)
always returns the given level with the given class. If that level does not exist or has a different class than it is (re)created.

Parameters:
level - is the level number that should be returned
clazz - is the class of the level, should be TextListLevelStyleImageElement, TextListLevelStyleBulletElement or TextListLevelStyleNumberElement.
Returns:
a list level style with the given level and class

getFamily

public OdfStyleFamily getFamily()
Overrides:
getFamily in class OdfStyleBase

getParentStyle

public OdfStyleBase getParentStyle()
Overrides:
getParentStyle in class OdfStyleBase


Copyright © 2008-2017 The Apache Software Foundation. All Rights Reserved.