LibreOffice Module xmerge (master) 1
Public Member Functions | Protected Attributes | List of all members
org.openoffice.xmerge.converter.xml.Style Class Reference

An object of class Style represents a style in an OpenOffice document. More...

Inheritance diagram for org.openoffice.xmerge.converter.xml.Style:
[legend]
Collaboration diagram for org.openoffice.xmerge.converter.xml.Style:
[legend]

Public Member Functions

 Style (Node node, StyleCatalog sc)
 Constructor for use when going from DOM to client device format. More...
 
 Style (String name, String family, String parent, StyleCatalog sc)
 Constructor for use when going from client device format to DOM. More...
 
void setCatalog (StyleCatalog sc)
 Set the StyleCatalog to be used when looking up the Style parent. More...
 
String getName ()
 Returns the name of this Style. More...
 
void setName (String newName)
 Sets the name of this Style. More...
 
String getFamily ()
 Return the family of this Style. More...
 
String getParent ()
 Return the name of the parent of this Style. More...
 
Style getResolved ()
 Return a Style object corresponding to this one, but with all of the inherited information from parent Style objects filled in. More...
 
Node createNode (org.w3c.dom.Document parentDoc, String name)
 Write a Node in parentDoc representing this Style. More...
 
boolean isSubset (Style style)
 Return true if Style is a subset of this one. More...
 

Protected Attributes

String name = null
 Name of the Style. More...
 
String family = null
 Family of the Style. More...
 
String parent = null
 Parent of the Style. More...
 
StyleCatalog sc
 A reference to the StyleCatalog to be used for looking up ancestor Style objects. More...
 

Detailed Description

An object of class Style represents a style in an OpenOffice document.

In practice subclasses of this Style, such as TextStyle, ParaStyle are used.

See also
TextStyle
ParaStyle

Definition at line 34 of file Style.java.

Constructor & Destructor Documentation

◆ Style() [1/2]

org.openoffice.xmerge.converter.xml.Style.Style ( Node  node,
StyleCatalog  sc 
)
inline

Constructor for use when going from DOM to client device format.

Parameters
nodeA 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.
scThe StyleCatalog, which is used for looking up ancestor Style objects.

Definition at line 59 of file Style.java.

References org.openoffice.xmerge.converter.xml.Style.family, i, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, and org.openoffice.xmerge.converter.xml.Style.sc.

Referenced by org.openoffice.xmerge.converter.xml.Style.getResolved().

◆ Style() [2/2]

org.openoffice.xmerge.converter.xml.Style.Style ( String  name,
String  family,
String  parent,
StyleCatalog  sc 
)
inline

Constructor for use when going from client device format to DOM.

Parameters
nameName of the Style. Can be null.
familyFamily of the Style - usually paragraph, text, etc. Can be null.
parentName of the parent Style, or null if none.
scThe StyleCatalog, which is used for looking up ancestor Style objects.

Definition at line 93 of file Style.java.

References org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, and org.openoffice.xmerge.converter.xml.Style.sc.

Member Function Documentation

◆ createNode()

Node org.openoffice.xmerge.converter.xml.Style.createNode ( org.w3c.dom.Document  parentDoc,
String  name 
)
inline

Write a Node in parentDoc representing this Style.

Note that the Node is returned unconnected.

Parameters
parentDocDocument to which new Node will belong.
nameName to use for new Node.

Reimplemented in org.openoffice.xmerge.converter.xml.ParaStyle, and org.openoffice.xmerge.converter.xml.TextStyle.

Definition at line 168 of file Style.java.

Referenced by org.openoffice.xmerge.converter.xml.StyleCatalog.writeNode().

◆ getFamily()

String org.openoffice.xmerge.converter.xml.Style.getFamily ( )
inline

Return the family of this Style.

Returns
The family of this Style.

Definition at line 134 of file Style.java.

References org.openoffice.xmerge.converter.xml.Style.family, and String.

Referenced by org.openoffice.xmerge.converter.xml.StyleCatalog.lookup(), and org.openoffice.xmerge.converter.xml.StyleCatalog.writeNode().

◆ getName()

String org.openoffice.xmerge.converter.xml.Style.getName ( )
inline

◆ getParent()

String org.openoffice.xmerge.converter.xml.Style.getParent ( )
inline

Return the name of the parent of this Style.

Returns
The parent of this Style.

Definition at line 143 of file Style.java.

References org.openoffice.xmerge.converter.xml.Style.parent, and String.

Referenced by org.openoffice.xmerge.converter.xml.StyleCatalog.lookup(), and org.openoffice.xmerge.converter.xml.StyleCatalog.writeNode().

◆ getResolved()

Style org.openoffice.xmerge.converter.xml.Style.getResolved ( )
inline

Return a 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.

Returns
A resolved Style object in which to look up ancestors.

Reimplemented in org.openoffice.xmerge.converter.xml.ParaStyle, org.openoffice.xmerge.converter.xml.sxc.CellStyle, org.openoffice.xmerge.converter.xml.sxc.ColumnStyle, org.openoffice.xmerge.converter.xml.sxc.RowStyle, and org.openoffice.xmerge.converter.xml.TextStyle.

Definition at line 156 of file Style.java.

References org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, and org.openoffice.xmerge.converter.xml.Style.Style().

◆ isSubset()

boolean org.openoffice.xmerge.converter.xml.Style.isSubset ( Style  style)
inline

Return true if 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.

Parameters
styleThe Style to check.
Returns
true if the Style is a subset, false otherwise.

Reimplemented in org.openoffice.xmerge.converter.xml.ParaStyle, org.openoffice.xmerge.converter.xml.sxc.CellStyle, org.openoffice.xmerge.converter.xml.sxc.ColumnStyle, org.openoffice.xmerge.converter.xml.sxc.RowStyle, and org.openoffice.xmerge.converter.xml.TextStyle.

Definition at line 188 of file Style.java.

◆ setCatalog()

void org.openoffice.xmerge.converter.xml.Style.setCatalog ( StyleCatalog  sc)
inline

Set the StyleCatalog to be used when looking up the Style parent.

Parameters
scThe StyleCatalog, which is used for looking up ancestor Style objects.

Definition at line 107 of file Style.java.

References org.openoffice.xmerge.converter.xml.Style.sc.

◆ setName()

void org.openoffice.xmerge.converter.xml.Style.setName ( String  newName)
inline

Member Data Documentation

◆ family

String org.openoffice.xmerge.converter.xml.Style.family = null
protected

◆ name

String org.openoffice.xmerge.converter.xml.Style.name = null
protected

◆ parent

String org.openoffice.xmerge.converter.xml.Style.parent = null
protected

◆ sc

StyleCatalog org.openoffice.xmerge.converter.xml.Style.sc
protected

A reference to the StyleCatalog to be used for looking up ancestor Style objects.

Definition at line 47 of file Style.java.

Referenced by org.openoffice.xmerge.converter.xml.Style.setCatalog(), and org.openoffice.xmerge.converter.xml.Style.Style().


The documentation for this class was generated from the following file: