|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openoffice.xmerge.converter.xml.Style
An object of class Style
represents a style
in an OpenOffice document. In practice subclasses of this
Style
, such as TextStyle
,
ParaStyle
are used.
Field Summary | |
protected java.lang.String |
family
Family of the Style . |
protected java.lang.String |
name
Name of the Style . |
protected java.lang.String |
parent
Parent of the Style . |
protected StyleCatalog |
sc
A reference to the StyleCatalog to be used for
looking up ancestor Style objects. |
Constructor Summary | |
Style(org.w3c.dom.Node node,
StyleCatalog sc)
Constructor for use when going from DOM to client device format. |
|
Style(java.lang.String name,
java.lang.String family,
java.lang.String parent,
StyleCatalog sc)
Constructor for use when going from client device format to DOM. |
Method Summary | |
org.w3c.dom.Node |
createNode(org.w3c.dom.Document parentDoc,
java.lang.String name)
Write a Node in parentDoc
representing this Style . |
java.lang.String |
getFamily()
Return the family of this Style . |
java.lang.String |
getName()
Returns the name of this Style . |
java.lang.String |
getParent()
Return the name of the parent of this Style . |
Style |
getResolved()
Return a Style object corresponding to this one, but with
all of the inherited information from parent Style
objects filled in. |
boolean |
isSubset(Style style)
Return true if Style is a subset of this one. |
void |
setCatalog(StyleCatalog sc)
Set the StyleCatalog to be used when looking up the
Style parent. |
void |
setName(java.lang.String newName)
Sets the name of this Style . |
void |
writeAttributes(org.w3c.dom.Node node)
Write this Style object's attributes to the given
Node . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String family
Style
.protected java.lang.String name
Style
.protected java.lang.String parent
Style
.protected StyleCatalog sc
StyleCatalog
to be used for
looking up ancestor Style
objects.Constructor Detail |
public Style(org.w3c.dom.Node node, StyleCatalog sc)
node
- A style:style or style:default-style
Node
from the document being parsed.
No checking of Node
is done, so if it
is not of the proper type the results will be
unpredictable.sc
- The StyleCatalog
, which is used for
looking up ancestor Style
objects.public Style(java.lang.String name, java.lang.String family, java.lang.String parent, StyleCatalog sc)
name
- Name of the Style
. Can be null.family
- Family of the Style
- usually
paragraph, text, etc. Can be null.parent
- Name of the parent Style
, or null if none.sc
- The StyleCatalog
, which is used for
looking up ancestor Style
objects.Method Detail |
public org.w3c.dom.Node createNode(org.w3c.dom.Document parentDoc, java.lang.String name)
Node
in parentDoc
representing this Style
. Note that the
Node
is returned unconnected.parentDoc
- Document to which new Node
will
belong.name
- Name to use for new Node
.public java.lang.String getFamily()
Style
.Style
.public java.lang.String getName()
Style
.Style
.public java.lang.String getParent()
Style
.Style
.public Style getResolved()
Style
object corresponding to this one, but with
all of the inherited information from parent Style
objects filled in. The object returned will be a new object, not a
reference to this object, even if it does not need any information
added.Style
object in which to look up
ancestors.public boolean isSubset(Style style)
Style
is a subset of this one. Note
that this will return true even if Style
is less
specific than this Style
, so long as it does not
contradict this Style
in any way.
This always returns true since only subclasses of
Style
contain any actual Style
information.style
- The Style
to checkStyle
is a subset, false otherwise.public void setCatalog(StyleCatalog sc)
StyleCatalog
to be used when looking up the
Style
parent.sc
- The StyleCatalog
, which is used for
looking up ancestor Style
objects.public void setName(java.lang.String newName)
Style
.newName
- The new name of this Style
.public void writeAttributes(org.w3c.dom.Node node)
Style
object's attributes to the given
Node
. This may involve writing child
Node
objects as well. This is similar to the
writeNode
method, but the Node
already exists, and this does not write the name,
family, and parent attributes, which are assumed to already
exist in the Node
.node
- The Node
to add style attributes.
|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |