Class OdfStyleBase
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
,OdfStylePropertySet
,Element
,ElementTraversal
,EventTarget
,Node
,NodeList
,TypeInfo
- Direct Known Subclasses:
StyleDefaultStyleElement
,StylePageLayoutElement
,StyleStyleElement
,TextListLevelStyleElementBase
,TextListStyleElement
,TextOutlineLevelStyleElement
public abstract class OdfStyleBase
extends OdfContainerElementBase
implements OdfStylePropertySet, Comparable
A placeholder for multiple style incarnation, for instance <style:style> from either the
automatic or the template styles parent, e.g. StyleStyleElement is inheriting from it
- See Also:
-
Field Summary
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
ConstructorsConstructorDescriptionOdfStyleBase
(OdfFileDom ownerDocument, String namespaceURI, String qualifiedName) Creates a new instance of OdfElementOdfStyleBase
(OdfFileDom ownerDocument, OdfName aName) Creates a new instance of OdfElement -
Method Summary
Modifier and TypeMethodDescriptionvoid
int
compare one style to another one.boolean
Indicates if some other object is equal to this one.getProperties
(Set<OdfStyleProperty> properties) gets more than one property at oncegetProperty
(OdfStyleProperty prop) returns the given property from this styleable element or style.get a map containing all properties of this style and their values.get a map containing all properties of this style and their values.int
Returns an iterator for allOdfStylableElement
elements using this style.int
hashCode()
boolean
hasProperty
(OdfStyleProperty prop) checks if this styleable element or style has this property directly set.protected void
onOdfNodeInserted
(OdfElement node, Node refChild) override this method to get notified about element insertionprotected void
onOdfNodeRemoved
(OdfElement node) override this method to get notified about element insertionvoid
removeProperty
(OdfStyleProperty property) removes the given property from this setvoid
void
setProperties
(Map<OdfStyleProperty, String> properties) set more than one property at once.void
setProperty
(OdfStyleProperty property, String value) sets a single style property for this element.Methods inherited from class org.odftoolkit.odfdom.pkg.OdfContainerElementBase
insertBefore, removeChild, replaceChild
Methods inherited from class org.odftoolkit.odfdom.pkg.OdfElement
accept, 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, getOdfName, 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, toString
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
-
Constructor Details
-
OdfStyleBase
public OdfStyleBase(OdfFileDom ownerDocument, String namespaceURI, String qualifiedName) throws DOMException Creates a new instance of OdfElement- Throws:
DOMException
-
OdfStyleBase
Creates a new instance of OdfElement- Throws:
DOMException
-
-
Method Details
-
addStyleUser
-
getStyleProperties
get a map containing all properties of this style and their values.- Returns:
- map of properties. @Deprecated Broken by design as the same OdfStlyeProperty can occur multiple times and would be overwritten (e.g. background color exist 3times in cells).
-
getStylePropertiesDeep
get a map containing all properties of this style and their values. The map will also include any properties set by parent styles- Returns:
- a map of all the properties. @Deprecated Broken by design as the same OdfStlyeProperty can occur multiple times and would be overwritten (e.g. background color exist 3times in cells).
-
removeStyleUser
-
getStyleUserCount
public int getStyleUserCount() -
getStyleUsers
Returns an iterator for allOdfStylableElement
elements using this style.- Returns:
- an iterator for all
OdfStylableElement
elements using this style
-
getFamilyName
-
getPropertiesElement
- Parameters:
set
-- Returns:
- the style:*-properties element for the given set. Returns null if such element does not exist yet.
-
getOrCreatePropertiesElement
- Parameters:
set
-- Returns:
- the style:*-properties element for the given set. If such element does not yet exist, it is created.
-
getProperty
Description copied from interface:OdfStylePropertySet
returns the given property from this styleable element or style. If it is not directly set, the value of this property from a parent style will be returned.- Specified by:
getProperty
in interfaceOdfStylePropertySet
- Parameters:
prop
- is the property which value will be returned.- Returns:
- a property value.
-
hasProperty
Description copied from interface:OdfStylePropertySet
checks if this styleable element or style has this property directly set.- Specified by:
hasProperty
in interfaceOdfStylePropertySet
- Parameters:
prop
- is the property to check.- Returns:
- true if this property is directly set at this instance or false if not.
-
onOdfNodeInserted
Description copied from class:OdfContainerElementBase
override this method to get notified about element insertion- Overrides:
onOdfNodeInserted
in classOdfContainerElementBase
-
onOdfNodeRemoved
Description copied from class:OdfContainerElementBase
override this method to get notified about element insertion- Overrides:
onOdfNodeRemoved
in classOdfContainerElementBase
-
getProperties
Description copied from interface:OdfStylePropertySet
gets more than one property at once- Specified by:
getProperties
in interfaceOdfStylePropertySet
- Parameters:
properties
- is a set of all properties that should be returned.- Returns:
- a map with all asked properties and theire value, if available.
-
getStrictProperties
- Specified by:
getStrictProperties
in interfaceOdfStylePropertySet
- Returns:
- a set with all properties which are specified in the strict odf format.
-
removeProperty
Description copied from interface:OdfStylePropertySet
removes the given property from this set- Specified by:
removeProperty
in interfaceOdfStylePropertySet
- Parameters:
property
- is the property to be removed
-
setProperties
Description copied from interface:OdfStylePropertySet
set more than one property at once.- Specified by:
setProperties
in interfaceOdfStylePropertySet
- Parameters:
properties
- is a map of properties with values that should be set.
-
setProperty
Description copied from interface:OdfStylePropertySet
sets a single style property for this element.- Specified by:
setProperty
in interfaceOdfStylePropertySet
- Parameters:
property
- is the property that you want to set.value
- is the value the property is set to.
-
compareTo
compare one style to another one. This implements a total order on style objects.- Specified by:
compareTo
in interfaceComparable
- Parameters:
obj
- - the reference object with which to compare2.- Returns:
- 0 if this object is the same as the obj argument; -1 if this object is less than the obj argument; 1 if this object is greater than the obj argument
-
equals
Indicates if some other object is equal to this one. The attribute style:name is ignored during compare2.- Overrides:
equals
in classOdfElement
- Parameters:
obj
- - the reference object with which to compare2.- Returns:
- true if this object is the same as the obj argument; false otherwise.
-
hashCode
public int hashCode() -
getFamily
- Returns:
- the style family of the style or null if none existent
-
getParentStyle
- Returns:
- the style parent of the style or null if none existent
-