org.odftoolkit.odfdom.incubator.doc.office
Class OdfOfficeStyles

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.office.OfficeStylesElement
                                  extended by org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles
All Implemented Interfaces:
Serializable, Cloneable, Element, EventTarget, Node, NodeList, TypeInfo

public class OdfOfficeStyles
extends OfficeStylesElement

Convenient functionalty for the parent ODF OpenDocument element

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.odftoolkit.odfdom.dom.element.office.OfficeStylesElement
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
OdfOfficeStyles(OdfFileDom ownerDoc)
           
 
Method Summary
 NumberBooleanStyleElement getBooleanStyle(String name)
          Returns the NumberBooleanStyleElement element with the given name.
 Iterable<NumberBooleanStyleElement> getBooleanStyles()
          Returns an iterator for all NumberBooleanStyleElement elements.
 OdfNumberCurrencyStyle getCurrencyStyle(String name)
          Returns the OdfNumberCurrencyStyle element with the given name.
 Iterable<OdfNumberCurrencyStyle> getCurrencyStyles()
          Returns an iterator for all OdfNumberCurrencyStyle elements.
 OdfNumberDateStyle getDateStyle(String name)
          Returns the OdfNumberDateStyle element with the given name.
 Iterable<OdfNumberDateStyle> getDateStyles()
          Returns an iterator for all OdfNumberDateStyle elements.
 OdfDefaultStyle getDefaultStyle(OdfStyleFamily familyType)
          Returns the OdfStyleDefaultStyle element.
 Iterable<OdfDefaultStyle> getDefaultStyles()
          Returns an iterator for all OdfStyleDefaultStyle elements.
 DrawFillImageElement getFillImage(String name)
          Returns the DrawFillImageElement element with the given name.
 Iterable<DrawFillImageElement> getFillImages()
          Returns an iterator for all DrawFillImageElement elements.
 DrawGradientElement getGradient(String name)
          Returns the DrawGradientElement element with the given name.
 Iterable<DrawGradientElement> getGradients()
          Returns an iterator for all DrawGradientElement elements.
 DrawHatchElement getHatch(String name)
          Returns the DrawHatchElement element with the given name.
 Iterable<DrawHatchElement> getHatches()
          Returns an iterator for all DrawHatchElement elements.
 OdfTextListStyle getListStyle(String name)
          Returns the OdfTextListStyle element with the given name.
 Iterable<OdfTextListStyle> getListStyles()
          Returns an iterator for all OdfTextListStyle elements.
 Iterable<DrawMarkerElement> getMarker()
          Returns an iterator for all DrawMarkerElement elements.
 DrawMarkerElement getMarker(String name)
          Returns the DrawMarkerElement element with the given name.
 OdfNumberStyle getNumberStyle(String name)
          Returns the OdfNumberNumberStyle element with the given name.
 Iterable<OdfNumberStyle> getNumberStyles()
          Returns an iterator for all OdfNumberNumberStyle elements.
 OdfDefaultStyle getOrCreateDefaultStyle(OdfStyleFamily family)
          Retrieve or create ODF default style
 OdfTextOutlineStyle getOrCreateOutlineStyle()
          Retrieve or create ODF OutlineStyle
 OdfTextOutlineStyle getOutlineStyle()
          Returns the OdfTextOutlineStyle element.
 OdfNumberPercentageStyle getPercentageStyle(String name)
          Returns the OdfNumberPercentageStyle element with the given name.
 Iterable<OdfNumberPercentageStyle> getPercentageStyles()
          Returns an iterator for all OdfNumberPercentageStyle 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.
 NumberTextStyleElement getTextStyle(String name)
          Returns the OdfNumberTextStyle element with the given name.
 Iterable<NumberTextStyleElement> getTextStyles()
          Returns an iterator for all OdfNumberTextStyle elements.
 OdfNumberTimeStyle getTimeStyle(String name)
          Returns the OdfNumberTimeStyle element with the given name.
 Iterable<OdfNumberTimeStyle> getTimeStyles()
          Returns an iterator for all OdfNumberTimeStyle elements.
 OdfTextListStyle newListStyle(String name)
          Create ODF TextListStyle
 OdfStyle newStyle(String name, OdfStyleFamily family)
          Create an ODF style with style name and family
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
 
Methods inherited from class org.odftoolkit.odfdom.dom.element.office.OfficeStylesElement
accept, getOdfName, newDrawFillImageElement, newDrawGradientElement, newDrawHatchElement, newDrawMarkerElement, newDrawOpacityElement, newDrawStrokeDashElement, newNumberBooleanStyleElement, newNumberCurrencyStyleElement, newNumberDateStyleElement, newNumberNumberStyleElement, newNumberPercentageStyleElement, newNumberTextStyleElement, newNumberTimeStyleElement, newStyleDefaultPageLayoutElement, newStyleDefaultStyleElement, newStylePresentationPageLayoutElement, newStyleStyleElement, newSvgLinearGradientElement, newSvgRadialGradientElement, newTableTableTemplateElement, newTextBibliographyConfigurationElement, newTextLinenumberingConfigurationElement, newTextListStyleElement, newTextNotesConfigurationElement, newTextOutlineStyleElement
 
Methods inherited from class org.odftoolkit.odfdom.pkg.OdfContainerElementBase
insertBefore, removeChild, replaceChild
 
Methods inherited from class org.odftoolkit.odfdom.pkg.OdfElement
cloneNode, equals, 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, 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

OdfOfficeStyles

public OdfOfficeStyles(OdfFileDom ownerDoc)
Method Detail

newStyle

public OdfStyle newStyle(String name,
                         OdfStyleFamily family)
Create an ODF style with style name and family

Parameters:
name - The style name
family - The style family
Returns:
The OdfStyle element

getOrCreateDefaultStyle

public OdfDefaultStyle getOrCreateDefaultStyle(OdfStyleFamily family)
Retrieve or create ODF default style

Parameters:
family - The style family
Returns:
The code>OdfDefaultStyle element

newListStyle

public OdfTextListStyle newListStyle(String name)
Create ODF TextListStyle

Parameters:
name - The style name
Returns:
The code>OdfTextListStyle element

getOrCreateOutlineStyle

public OdfTextOutlineStyle getOrCreateOutlineStyle()
Retrieve or create ODF OutlineStyle

Returns:
The code>OdfTextOutlineStyle element

getOutlineStyle

public OdfTextOutlineStyle getOutlineStyle()
Returns the OdfTextOutlineStyle element.

Returns:
a pointer to the outline stye or null if there is no such element

getDefaultStyle

public OdfDefaultStyle getDefaultStyle(OdfStyleFamily familyType)
Returns the OdfStyleDefaultStyle element.

Parameters:
familyType - is the family for the default style
Returns:
the default style with the given family or null if there is no such default style

getDefaultStyles

public Iterable<OdfDefaultStyle> getDefaultStyles()
Returns an iterator for all OdfStyleDefaultStyle elements.

Returns:
iterator for all OdfStyleDefaultStyle elements

getMarker

public DrawMarkerElement getMarker(String name)
Returns the DrawMarkerElement element with the given name.

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

getMarker

public Iterable<DrawMarkerElement> getMarker()
Returns an iterator for all DrawMarkerElement elements.

Returns:
an iterator for all DrawMarkerElement elements

getGradient

public DrawGradientElement getGradient(String name)
Returns the DrawGradientElement element with the given name.

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

getGradients

public Iterable<DrawGradientElement> getGradients()
Returns an iterator for all DrawGradientElement elements.

Returns:
an iterator for all DrawGradientElement elements

getHatch

public DrawHatchElement getHatch(String name)
Returns the DrawHatchElement element with the given name.

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

getHatches

public Iterable<DrawHatchElement> getHatches()
Returns an iterator for all DrawHatchElement elements.

Returns:
an iterator for all DrawHatchElement elements

getFillImage

public DrawFillImageElement getFillImage(String name)
Returns the DrawFillImageElement element with the given name.

Parameters:
name - is the name of the fill image
Returns:
the fill image or null if there is no such fill image

getFillImages

public Iterable<DrawFillImageElement> getFillImages()
Returns an iterator for all DrawFillImageElement elements.

Returns:
an iterator for all DrawFillImageElement elements

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 OdfTextListStyle getListStyle(String name)
Returns the OdfTextListStyle 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<OdfTextListStyle> getListStyles()
Returns an iterator for all OdfTextListStyle elements.

Returns:
an iterator for all OdfTextListStyle elements

getNumberStyle

public OdfNumberStyle getNumberStyle(String name)
Returns the OdfNumberNumberStyle 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 OdfNumberNumberStyle elements.

Returns:
an iterator for all OdfNumberNumberStyle elements

getDateStyle

public OdfNumberDateStyle getDateStyle(String name)
Returns the OdfNumberDateStyle 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<OdfNumberDateStyle> getDateStyles()
Returns an iterator for all OdfNumberDateStyle elements.

Returns:
an iterator for all OdfNumberDateStyle elements

getPercentageStyle

public OdfNumberPercentageStyle getPercentageStyle(String name)
Returns the OdfNumberPercentageStyle 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<OdfNumberPercentageStyle> getPercentageStyles()
Returns an iterator for all OdfNumberPercentageStyle elements.

Returns:
an iterator for all OdfNumberPercentageStyle elements

getCurrencyStyle

public OdfNumberCurrencyStyle getCurrencyStyle(String name)
Returns the OdfNumberCurrencyStyle 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<OdfNumberCurrencyStyle> getCurrencyStyles()
Returns an iterator for all OdfNumberCurrencyStyle elements.

Returns:
an iterator for all OdfNumberCurrencyStyle elements

getTimeStyle

public OdfNumberTimeStyle getTimeStyle(String name)
Returns the OdfNumberTimeStyle 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<OdfNumberTimeStyle> getTimeStyles()
Returns an iterator for all OdfNumberTimeStyle elements.

Returns:
an iterator for all OdfNumberTimeStyle elements

getBooleanStyle

public NumberBooleanStyleElement getBooleanStyle(String name)
Returns the NumberBooleanStyleElement 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<NumberBooleanStyleElement> getBooleanStyles()
Returns an iterator for all NumberBooleanStyleElement elements.

Returns:
an iterator for all NumberBooleanStyleElement elements

getTextStyle

public NumberTextStyleElement getTextStyle(String name)
Returns the OdfNumberTextStyle 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<NumberTextStyleElement> getTextStyles()
Returns an iterator for all OdfNumberTextStyle elements.

Returns:
an iterator for all OdfNumberTextStyle elements

onOdfNodeInserted

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

Overrides:
onOdfNodeInserted in class OdfContainerElementBase

onOdfNodeRemoved

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

Overrides:
onOdfNodeRemoved in class OdfContainerElementBase


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