com.spire.doc.documents
Class Style

java.lang.Object
  extended by com.spire.doc.OwnerHolder
      extended by com.spire.doc.documents.xml.DocumentSerializable
          extended by com.spire.doc.documents.Style
All Implemented Interfaces:
IDocumentSerializable, IStyle
Direct Known Subclasses:
ListStyle, ParagraphStyle

public abstract class Style
extends DocumentSerializable
implements IStyle

Base class for paragraph and character styles.


Nested Class Summary
static class Style.BuiltinStyleLoader
          The base class BuiltinStyleLoader specifies Built-in styles.
 
Constructor Summary
protected Style(Document doc)
           
 
Method Summary
 void applyBaseStyle(BuiltinStyle bStyle)
          Applies the base style.
 void applyBaseStyle(java.lang.String styleName)
          Apply base style for current style.
static Style createBuiltinStyle(BuiltinStyle bStyle, Document doc)
          Creates the built-in paragraph style.
static IStyle createBuiltinStyle(BuiltinStyle bStyle, StyleType type, Document doc)
          Creates the built-in style.
abstract  IStyle deepClone()
          Clones itself
 CharacterFormat getCharacterFormat()
          Gets the character format.
 java.lang.String getName()
          Returns or sets style name.
 java.lang.String getStyleId()
          Gets or sets the style id.
abstract  StyleType getStyleType()
          Gets the type of the style.
 boolean isCustomStyle()
          Gets or sets a value indicating whether this instance is custom style.
 void isCustomStyle(boolean value)
          Gets or sets a value indicating whether this instance is custom style.
 boolean isHeading()
           
static BuiltinStyle nameToBuiltIn(java.lang.String styleName)
          Converts string style names to BuiltinStyle.
 void setName(java.lang.String value)
          Returns or sets style name.
 
Methods inherited from class com.spire.doc.OwnerHolder
getDocument
 

Constructor Detail

Style

protected Style(Document doc)
Method Detail

getCharacterFormat

public CharacterFormat getCharacterFormat()
Gets the character format.

Returns:
The character format.

getName

public java.lang.String getName()
Returns or sets style name.

Specified by:
getName in interface IStyle
Returns:

setName

public void setName(java.lang.String value)
Returns or sets style name.

Specified by:
setName in interface IStyle
Parameters:
value - String

getStyleId

public java.lang.String getStyleId()
Gets or sets the style id.

Specified by:
getStyleId in interface IStyle
Returns:
String

getStyleType

public abstract StyleType getStyleType()
Gets the type of the style.

Specified by:
getStyleType in interface IStyle
Returns:
The type of the style.

isCustomStyle

public boolean isCustomStyle()
Gets or sets a value indicating whether this instance is custom style.

Returns:
if this instance is custom, set to true.

isCustomStyle

public void isCustomStyle(boolean value)
Gets or sets a value indicating whether this instance is custom style.


isHeading

public boolean isHeading()

applyBaseStyle

public void applyBaseStyle(java.lang.String styleName)
Apply base style for current style.

Parameters:
styleName -

applyBaseStyle

public void applyBaseStyle(BuiltinStyle bStyle)
Applies the base style.

Parameters:
bStyle - The built-in style.

deepClone

public abstract IStyle deepClone()
Clones itself

Specified by:
deepClone in interface IStyle
Returns:

createBuiltinStyle

public static Style createBuiltinStyle(BuiltinStyle bStyle,
                                       Document doc)
Creates the built-in paragraph style.

Parameters:
bstyle - The built in style.
doc - The document.
Returns:

createBuiltinStyle

public static IStyle createBuiltinStyle(BuiltinStyle bStyle,
                                        StyleType type,
                                        Document doc)
Creates the built-in style.

Parameters:
bStyle - The built-in style.
type - The type.
doc - The document.
Returns:

nameToBuiltIn

public static BuiltinStyle nameToBuiltIn(java.lang.String styleName)
Converts string style names to BuiltinStyle.

Parameters:
styleName - Name of the style.
Returns: