public class Style
extends java.lang.Object
implements java.lang.Cloneable
| Modifier | Constructor and Description |
|---|---|
protected |
Style(int styleType)
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearParaAttrs() |
void |
clearRunAttrs() |
boolean |
equals(Style style)
Compares with the specified style.
|
java.lang.Object |
fetchInheritedParaAttr(int key) |
java.lang.Object |
fetchInheritedRunAttr(int key) |
java.lang.Object |
fetchParaAttr(int key) |
java.lang.String[] |
getAliases()
Gets all aliases of this style.
|
java.lang.String |
getBaseStyleName()
Gets/sets the name of the style this style is based on.
|
boolean |
getBuiltIn()
True if this style is one of the built-in styles in MS Word.
|
java.lang.Object |
getDirectParaAttr(int key) |
java.lang.Object |
getDirectParaAttr(int key,
int revisionsView) |
java.lang.Object |
getDirectRunAttr(int key) |
DocumentBase |
getDocument()
Gets the owner document.
|
Font |
getFont()
Gets the character formatting of the style.
|
java.lang.String |
getLinkedStyleName()
Gets the name of the Style linked to this one.
|
List |
getList()
Gets the list that defines formatting of this list style.
|
ListFormat |
getListFormat()
Provides access to the list formatting properties of a paragraph style.
|
java.lang.String |
getName()
Gets the name of the style.
|
java.lang.String |
getNextParagraphStyleName()
Gets/sets the name of the style to be applied automatically to a new paragraph inserted after a paragraph formatted with the specified style.
|
ParagraphFormat |
getParagraphFormat()
Gets the paragraph formatting of the style.
|
int |
getStyleIdentifier()
Gets the locale independent style identifier for a built-in style.
|
StyleCollection |
getStyles()
Gets the collection of styles this style belongs to.
|
int |
getType()
Gets the style type (paragraph or character).
|
boolean |
isHeading()
True when the style is one of the built-in Heading styles.
|
boolean |
isQuickStyle()
Specifies whether this style is shown in the Quick Style gallery inside MS Word UI.
|
void |
isQuickStyle(boolean value)
Specifies whether this style is shown in the Quick Style gallery inside MS Word UI.
|
protected java.lang.Object |
memberwiseClone() |
void |
remove()
Removes the specified style from the document.
|
void |
removeParaAttr(int key) |
void |
removeRunAttr(int key) |
void |
setBaseStyleName(java.lang.String value)
Gets/sets the name of the style this style is based on.
|
void |
setName(java.lang.String value)
Sets the name of the style.
|
void |
setNextParagraphStyleName(java.lang.String value)
Gets/sets the name of the style to be applied automatically to a new paragraph inserted after a paragraph formatted with the specified style.
|
void |
setParaAttr(int key,
java.lang.Object value) |
void |
setRunAttr(int key,
java.lang.Object value) |
public java.lang.String getName()
Can not be empty string.
If there already is a style with such name in the collection, then this style will override it. All affected nodes will reference new style.
public void setName(java.lang.String value)
Can not be empty string.
If there already is a style with such name in the collection, then this style will override it. All affected nodes will reference new style.
value - The name of the style.public int getStyleIdentifier()
For user defined (custom) styles, this property returns StyleIdentifier.USER.
StyleIdentifier constants.getName(),
setName(java.lang.String)public java.lang.String[] getAliases()
public boolean isHeading()
boolean value.public int getType()
StyleType constants.public DocumentBase getDocument()
public java.lang.String getLinkedStyleName()
public java.lang.String getBaseStyleName()
String value.public void setBaseStyleName(java.lang.String value)
value - The corresponding String value.public java.lang.String getNextParagraphStyleName()
String value.public void setNextParagraphStyleName(java.lang.String value)
value - The corresponding String value.public boolean getBuiltIn()
boolean value.public Font getFont()
For list styles this property returns null.
public ParagraphFormat getParagraphFormat()
For character and list styles this property returns null.
public List getList()
This property is only valid for list styles. For other style types this property returns null.
public ListFormat getListFormat()
This property is only valid for paragraph styles. For other style types this property returns null.
ListFormat value.public boolean isQuickStyle()
boolean value.public void isQuickStyle(boolean value)
value - The corresponding boolean value.public StyleCollection getStyles()
public void remove()
public boolean equals(Style style)
public java.lang.Object getDirectParaAttr(int key)
public java.lang.Object getDirectParaAttr(int key,
int revisionsView)
public java.lang.Object fetchParaAttr(int key)
public java.lang.Object fetchInheritedParaAttr(int key)
public void setParaAttr(int key,
java.lang.Object value)
public void removeParaAttr(int key)
public void clearParaAttrs()
public java.lang.Object getDirectRunAttr(int key)
public java.lang.Object fetchInheritedRunAttr(int key)
public void setRunAttr(int key,
java.lang.Object value)
public void removeRunAttr(int key)
public void clearRunAttrs()
protected java.lang.Object memberwiseClone()