org.odftoolkit.odfdom.doc.element.office
Class OdfAutomaticStyles

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.dom.element.OdfElement
                          extended by org.odftoolkit.odfdom.dom.element.OdfContainerElementBase
                              extended by org.odftoolkit.odfdom.dom.element.office.OdfAutomaticStylesElement
                                  extended by org.odftoolkit.odfdom.doc.element.office.OdfAutomaticStyles
All Implemented Interfaces:
Serializable, Cloneable, Element, EventTarget, Node, NodeList, TypeInfo

public class OdfAutomaticStyles
extends OdfAutomaticStylesElement

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.odftoolkit.odfdom.dom.element.office.OdfAutomaticStylesElement
ELEMENT_NAME
 
Fields inherited from class org.odftoolkit.odfdom.dom.element.OdfElement
mOdfDocument
 
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
OdfAutomaticStyles(OdfFileDom _aOwnerDoc)
           
 
Method Summary
 OdfListStyle createListStyle()
           
 OdfStyle createStyle(OdfStyleFamily styleFamily)
           
 OdfBooleanStyle getBooleanStyle(String name)
          Returns the OdfBooleanStyle element with the given name.
 Iterable<OdfBooleanStyle> getBooleanStyles()
          Returns an iterator for all OdfBooleanStyle elements.
 OdfCurrencyStyle getCurrencyStyle(String name)
          Returns the OdfCurrencyStyle element with the given name.
 Iterable<OdfCurrencyStyle> getCurrencyStyles()
          Returns an iterator for all OdfCurrencyStyle elements.
 OdfDateStyle getDateStyle(String name)
          Returns the OdfDateStyle element with the given name.
 Iterable<OdfDateStyle> getDateStyles()
          Returns an iterator for all OdfDateStyle elements.
 OdfListStyle getListStyle(String name)
          Returns the OdfListStyle element with the given name.
 Iterable<OdfListStyle> getListStyles()
          Returns an iterator for all OdfListStyle elements.
 OdfNumberStyle getNumberStyle(String name)
          Returns the OdfNumberStyle element with the given name.
 Iterable<OdfNumberStyle> getNumberStyles()
          Returns an iterator for all OdfNumberStyle elements.
 OdfPageLayout getPageLayout(String name)
          Returns the OdfPageLayout element with the given name.
 OdfPercentageStyle getPercentageStyle(String name)
          Returns the OdfPercentageStyle element with the given name.
 Iterable<OdfPercentageStyle> getPercentageStyles()
          Returns an iterator for all OdfPercentageStyle elements.
 OdfStyle getStyle(String name, OdfStyleFamily familyType)
          Returns the OdfStyle element with the given name and family.
 Iterable<OdfStyle> getStylesForFamily(OdfStyleFamily familyType)
          Returns an iterator for all OdfStyle elements for the given family.
 OdfTextStyle getTextStyle(String name)
          Returns the OdfTextStyle element with the given name.
 Iterable<OdfTextStyle> getTextStyles()
          Returns an iterator for all OdfTextStyle elements.
 OdfTimeStyle getTimeStyle(String name)
          Returns the OdfTimeStyle element with the given name.
 Iterable<OdfTimeStyle> getTimeStyles()
          Returns an iterator for all OdfTimeStyle elements.
 OdfStyle makeStyleUnique(OdfStyle referenceStyle)
           
protected  void onOdfNodeInserted(OdfElement node, Node refNode)
          override this method to get notified about element insertion
protected  void onOdfNodeRemoved(OdfElement node)
          override this method to get notified about element insertion
 void optimize()
          this methods removes all automatic styles that are currently not used by any styleable element.
 
Methods inherited from class org.odftoolkit.odfdom.dom.element.office.OdfAutomaticStylesElement
createBooleanStyleElement, createCurrencyStyleElement, createDateStyleElement, createListStyleElement, createNumberStyleElement, createPageLayoutElement, createPercentageStyleElement, createStyleElement, createTextStyleElement, createTimeStyleElement, getOdfName
 
Methods inherited from class org.odftoolkit.odfdom.dom.element.OdfContainerElementBase
insertBefore, removeChild, replaceChild
 
Methods inherited from class org.odftoolkit.odfdom.dom.element.OdfElement
cloneNode, equals, findFirstChildNode, findNextChildNode, findPreviousChildNode, getAncestorAs, getOdfAttribute, getParentAs, hasOdfAttribute, onInsertNode, onInsertNode, onRemoveNode, onRemoveNode, setOdfAttribute, 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, hashCode, 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
 

Constructor Detail

OdfAutomaticStyles

public OdfAutomaticStyles(OdfFileDom _aOwnerDoc)
Method Detail

createStyle

public OdfStyle createStyle(OdfStyleFamily styleFamily)

createListStyle

public OdfListStyle createListStyle()

getPageLayout

public OdfPageLayout getPageLayout(String name)
Returns the OdfPageLayout element with the given name.

Parameters:
name - is the name of the page layout
Returns:
the page layout or null if there is no such page layout

getStyle

public OdfStyle getStyle(String name,
                         OdfStyleFamily familyType)
Returns the OdfStyle element with the given name and family.

Parameters:
name - is the name of the style
familyType - is the family of the style
Returns:
the style or null if there is no such style

getStylesForFamily

public Iterable<OdfStyle> getStylesForFamily(OdfStyleFamily familyType)
Returns an iterator for all OdfStyle elements for the given family.

Parameters:
familyType -
Returns:
an iterator for all OdfStyle elements for the given family

getListStyle

public OdfListStyle getListStyle(String name)
Returns the OdfListStyle element with the given name.

Parameters:
name - is the name of the list style
Returns:
the list style or null if there is no such list style

getListStyles

public Iterable<OdfListStyle> getListStyles()
Returns an iterator for all OdfListStyle elements.

Returns:
an iterator for all OdfListStyle elements

getNumberStyle

public OdfNumberStyle getNumberStyle(String name)
Returns the OdfNumberStyle element with the given name.

Parameters:
name - is the name of the number style
Returns:
the number style or null if there is no such number style

getNumberStyles

public Iterable<OdfNumberStyle> getNumberStyles()
Returns an iterator for all OdfNumberStyle elements.

Returns:
an iterator for all OdfNumberStyle elements

getDateStyle

public OdfDateStyle getDateStyle(String name)
Returns the OdfDateStyle element with the given name.

Parameters:
name - is the name of the date style
Returns:
the date style or null if there is no such date style

getDateStyles

public Iterable<OdfDateStyle> getDateStyles()
Returns an iterator for all OdfDateStyle elements.

Returns:
an iterator for all OdfDateStyle elements

getPercentageStyle

public OdfPercentageStyle getPercentageStyle(String name)
Returns the OdfPercentageStyle element with the given name.

Parameters:
name - is the name of the percentage style
Returns:
the percentage style null if there is no such percentage style

getPercentageStyles

public Iterable<OdfPercentageStyle> getPercentageStyles()
Returns an iterator for all OdfPercentageStyle elements.

Returns:
an iterator for all OdfPercentageStyle elements

getCurrencyStyle

public OdfCurrencyStyle getCurrencyStyle(String name)
Returns the OdfCurrencyStyle element with the given name.

Parameters:
name - is the name of the currency style
Returns:
the currency style null if there is no such currency style

getCurrencyStyles

public Iterable<OdfCurrencyStyle> getCurrencyStyles()
Returns an iterator for all OdfCurrencyStyle elements.

Returns:
an iterator for all OdfCurrencyStyle elements

getTimeStyle

public OdfTimeStyle getTimeStyle(String name)
Returns the OdfTimeStyle element with the given name.

Parameters:
name - is the name of the time style
Returns:
the time style null if there is no such time style

getTimeStyles

public Iterable<OdfTimeStyle> getTimeStyles()
Returns an iterator for all OdfTimeStyle elements.

Returns:
an iterator for all OdfTimeStyle elements

getBooleanStyle

public OdfBooleanStyle getBooleanStyle(String name)
Returns the OdfBooleanStyle element with the given name.

Parameters:
name - is the name of the boolean style
Returns:
the boolean style null if there is no such boolean style

getBooleanStyles

public Iterable<OdfBooleanStyle> getBooleanStyles()
Returns an iterator for all OdfBooleanStyle elements.

Returns:
an iterator for all OdfBooleanStyle elements

getTextStyle

public OdfTextStyle getTextStyle(String name)
Returns the OdfTextStyle element with the given name.

Parameters:
name - is the name of the text style
Returns:
the text style null if there is no such text style

getTextStyles

public Iterable<OdfTextStyle> getTextStyles()
Returns an iterator for all OdfTextStyle elements.

Returns:
an iterator for all OdfTextStyle elements

onOdfNodeInserted

protected void onOdfNodeInserted(OdfElement node,
                                 Node refNode)
Description copied from class: OdfContainerElementBase
override this method to get notified about element insertion

Specified by:
onOdfNodeInserted in class OdfContainerElementBase

onOdfNodeRemoved

protected void onOdfNodeRemoved(OdfElement node)
Description copied from class: OdfContainerElementBase
override this method to get notified about element insertion

Specified by:
onOdfNodeRemoved in class OdfContainerElementBase

optimize

public void optimize()
this methods removes all automatic styles that are currently not used by any styleable element. Todo: In the future this could also merge automatic styles with identical content.


makeStyleUnique

public OdfStyle makeStyleUnique(OdfStyle referenceStyle)


Copyright © 2009. All Rights Reserved.