Class OdfTextListStyle
java.lang.Object
org.apache.xerces.dom.NodeImpl
org.apache.xerces.dom.ChildNode
org.apache.xerces.dom.ParentNode
org.apache.xerces.dom.ElementImpl
org.apache.xerces.dom.ElementNSImpl
org.odftoolkit.odfdom.pkg.OdfElement
org.odftoolkit.odfdom.pkg.OdfContainerElementBase
org.odftoolkit.odfdom.dom.element.OdfStyleBase
org.odftoolkit.odfdom.dom.element.text.TextListStyleElement
org.odftoolkit.odfdom.incubator.doc.text.OdfTextListStyle
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
,OdfStylePropertySet
,Element
,ElementTraversal
,EventTarget
,Node
,NodeList
,TypeInfo
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
Maximum number of levels in a list.static final boolean
List should show all levels of numbering.static final boolean
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
ConstructorsConstructorDescriptionOdfTextListStyle
(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
Modifier and TypeMethodDescriptiongetLevel
(int level) returns the given level or null if it does not existgetOrCreateListLevel
(int level, Class clazz) always returns the given level with the given class.toString()
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
appendChild, appendUsingWhitespaceHandling, cloneElement, cloneNode, cloneNode, cloneNode, cloneOdfElement, componentSize, copyAttributes, countChildComponents, countDescendantComponents, countPrecedingSiblingElements, delete, findFirstChildNode, findNextChildNode, findPreviousChildNode, getAncestorAs, getChildElement, getChildElement, getComponent, getComponentRoot, getFirstChildElement, getLastChildElement, getNextSiblingElement, getOdfAttribute, getOdfAttribute, getOdfAttribute, getOdfAttributeValue, getParentAs, getPreviousSiblingElement, getRepetition, getTextContent, hasAncestor, hasOdfAttribute, ignoredComponent, insert, insert, isComponentRoot, isIgnoredElement, isIgnoredElement, isRepeatable, markAsComponentRoot, markText, moveChildrenTo, onInsertNode, onInsertNode, onRemoveNode, onRemoveNode, receiveNode, receiveNode, removeContent, removeSingleElement, selfAndDescendantTextIgnoredAsComponent, setComponent, setOdfAttribute, setOdfAttribute, setOdfAttributeValue, setRepetition, split
Methods inherited from class org.apache.xerces.dom.ElementNSImpl
getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, getXMLBaseAttribute, isDerivedFrom, setPrefix, setType
Methods inherited from class org.apache.xerces.dom.ElementImpl
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getChildElementCount, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getLastElementChild, getNextElementSibling, getNodeName, getNodeType, getPreviousElementSibling, 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, 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, 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
compareDocumentPosition, getChildNodes, getFeature, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getUserData, hasChildNodes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setNodeValue, setTextContent, setUserData
-
Field Details
-
MAX_LIST_LEVEL
protected static final int MAX_LIST_LEVELMaximum number of levels in a list.- See Also:
-
SHOW_ALL_LEVELS
public static final boolean SHOW_ALL_LEVELSList should show all levels of numbering.- See Also:
-
SHOW_ONE_LEVEL
public static final boolean SHOW_ONE_LEVELList should show only one level of numbering.- See Also:
-
-
Constructor Details
-
OdfTextListStyle
-
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 widthshowAllLevels
- 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 widthshowAllLevels
- true if you want to display all levels of numbering, false otherwise.
-
-
Method Details
-
getLevel
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
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 returnedclazz
- is the class of the level, should be TextListLevelStyleImageElement, TextListLevelStyleBulletElement or TextListLevelStyleNumberElement.- Returns:
- a list level style with the given level and class
-
getFamily
- Overrides:
getFamily
in classOdfStyleBase
- Returns:
- the style family of the style or null if none existent
-
getParentStyle
- Overrides:
getParentStyle
in classOdfStyleBase
- Returns:
- the style parent of the style or null if none existent
-
toString
- Overrides:
toString
in classOdfElement
-