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
mPackageDocumentFields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURIFields inherited from class org.apache.xerces.dom.ElementImpl
attributes, nameFields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocumentFields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSiblingFields 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_NODEFields 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_NODEFields 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 TypeMethodDescriptionvoidintcompare one style to another one.booleanIndicates 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.intReturns an iterator for allOdfStylableElementelements using this style.inthashCode()booleanhasProperty(OdfStyleProperty prop) checks if this styleable element or style has this property directly set.protected voidonOdfNodeInserted(OdfElement node, Node refChild) override this method to get notified about element insertionprotected voidonOdfNodeRemoved(OdfElement node) override this method to get notified about element insertionvoidremoveProperty(OdfStyleProperty property) removes the given property from this setvoidvoidsetProperties(Map<OdfStyleProperty, String> properties) set more than one property at once.voidsetProperty(OdfStyleProperty property, String value) sets a single style property for this element.Methods inherited from class org.odftoolkit.odfdom.pkg.OdfContainerElementBase
insertBefore, removeChild, replaceChildMethods 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, toStringMethods inherited from class org.apache.xerces.dom.ElementNSImpl
getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, getXMLBaseAttribute, isDerivedFrom, setPrefix, setTypeMethods 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, synchronizeDataMethods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, hasChildNodes, item, setTextContent, synchronizeChildrenMethods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSiblingMethods 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, setUserDataMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 allOdfStylableElementelements using this style.- Returns:
- an iterator for all
OdfStylableElementelements 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:OdfStylePropertySetreturns 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:
getPropertyin interfaceOdfStylePropertySet- Parameters:
prop- is the property which value will be returned.- Returns:
- a property value.
-
hasProperty
Description copied from interface:OdfStylePropertySetchecks if this styleable element or style has this property directly set.- Specified by:
hasPropertyin 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:OdfContainerElementBaseoverride this method to get notified about element insertion- Overrides:
onOdfNodeInsertedin classOdfContainerElementBase
-
onOdfNodeRemoved
Description copied from class:OdfContainerElementBaseoverride this method to get notified about element insertion- Overrides:
onOdfNodeRemovedin classOdfContainerElementBase
-
getProperties
Description copied from interface:OdfStylePropertySetgets more than one property at once- Specified by:
getPropertiesin 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:
getStrictPropertiesin interfaceOdfStylePropertySet- Returns:
- a set with all properties which are specified in the strict odf format.
-
removeProperty
Description copied from interface:OdfStylePropertySetremoves the given property from this set- Specified by:
removePropertyin interfaceOdfStylePropertySet- Parameters:
property- is the property to be removed
-
setProperties
Description copied from interface:OdfStylePropertySetset more than one property at once.- Specified by:
setPropertiesin interfaceOdfStylePropertySet- Parameters:
properties- is a map of properties with values that should be set.
-
setProperty
Description copied from interface:OdfStylePropertySetsets a single style property for this element.- Specified by:
setPropertyin 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:
compareToin 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:
equalsin 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
-