com.aspose.words
Class Style

java.lang.Object
    extended by com.aspose.words.Style
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
TableStyle

public class Style 
extends java.lang.Object

Represents a single built-in or user-defined style.

Property Getters/Setters Summary
java.lang.String[]getAliases()
           Gets all aliases of this style. If style has no aliases then empty array of string is returned.
java.lang.StringgetBaseStyleName()
voidsetBaseStyleName(java.lang.String value)
           Gets/sets the name of the style this style is based on.
booleangetBuiltIn()
           True if this style is one of the built-in styles in MS Word.
DocumentBasegetDocument()
           Gets the owner document.
FontgetFont()
           Gets the character formatting of the style.
booleanisHeading()
           True when the style is one of the built-in Heading styles.
booleanisQuickStyle()
voidisQuickStyle(boolean value)
           Specifies whether this style is shown in the Quick Style gallery inside MS Word UI.
java.lang.StringgetLinkedStyleName()
           Gets the name of the Style linked to this one. Returns Empty string if no styles are linked.
Aspose.Words.Lists.ListgetList()
           Gets the list that defines formatting of this list style.
ListFormatgetListFormat()
           Provides access to the list formatting properties of a paragraph style.
java.lang.StringgetName()
voidsetName(java.lang.String value)
           Gets or sets the name of the style.
java.lang.StringgetNextParagraphStyleName()
voidsetNextParagraphStyleName(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.
ParagraphFormatgetParagraphFormat()
           Gets the paragraph formatting of the style.
intgetStyleIdentifier()
           Gets the locale independent style identifier for a built-in style. The value of the property is StyleIdentifier integer constant.
StyleCollectiongetStyles()
           Gets the collection of styles this style belongs to.
intgetType()
           Gets the style type (paragraph or character). The value of the property is StyleType integer constant.
 
Method Summary
voidclearParaAttrs()
          Reserved for internal use.
voidclearRunAttrs()
          Reserved for internal use.
java.lang.ObjectfetchInheritedParaAttr(int key)
          Reserved for internal use.
java.lang.ObjectfetchInheritedRunAttr(int key)
          Reserved for internal use.
java.lang.ObjectfetchParaAttr(int key)
          Reserved for internal use.
java.lang.ObjectgetDirectParaAttr(int key)
          Reserved for internal use.
intgetDirectParaAttrsCount()
          Reserved for internal use.
intgetDirectParaKey(int index)
          Reserved for internal use.
java.lang.ObjectgetDirectRunAttr(int key)
          Reserved for internal use.
intgetDirectRunAttrsCount()
          Reserved for internal use.
voidremove()
           Removes the specified style from the document.
voidremoveParaAttr(int key)
          Reserved for internal use.
voidremoveRunAttr(int key)
          Reserved for internal use.
voidsetParaAttr(int key, java.lang.Object value)
          Reserved for internal use.
voidsetRunAttr(int key, java.lang.Object value)
          Reserved for internal use.
 

Property Getters/Setters Detail

getAliases

public java.lang.String[] getAliases()
Gets all aliases of this style. If style has no aliases then empty array of string is returned.

getBaseStyleName/setBaseStyleName

public java.lang.String getBaseStyleName() / public void setBaseStyleName(java.lang.String value)
Gets/sets the name of the style this style is based on. This will be an empty string if the style is not based on any other style and it can be set to an empty string.

getBuiltIn

public boolean getBuiltIn()
True if this style is one of the built-in styles in MS Word.

getDocument

public DocumentBase getDocument()
Gets the owner document.

getFont

public Font getFont()
Gets the character formatting of the style.

For list styles this property returns null.


isHeading

public boolean isHeading()
True when the style is one of the built-in Heading styles.

isQuickStyle/isQuickStyle

public boolean isQuickStyle() / public void isQuickStyle(boolean value)
Specifies whether this style is shown in the Quick Style gallery inside MS Word UI.

getLinkedStyleName

public java.lang.String getLinkedStyleName()
Gets the name of the Style linked to this one. Returns Empty string if no styles are linked.

getList

public Aspose.Words.Lists.List getList()
Gets the list that defines formatting of this list style.

This property is only valid for list styles. For other style types this property returns null.


getListFormat

public ListFormat getListFormat()
Provides access to the list formatting properties of a paragraph style.

This property is only valid for paragraph styles. For other style types this property returns null.


getName/setName

public java.lang.String getName() / public void setName(java.lang.String value)
Gets or sets the name of the style.

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.


getNextParagraphStyleName/setNextParagraphStyleName

public java.lang.String getNextParagraphStyleName() / public 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. This property is not used by Aspose.Words. The next paragraph style will only be applied automatically when you edit the document in MS Word.

getParagraphFormat

public ParagraphFormat getParagraphFormat()
Gets the paragraph formatting of the style.

For character and list styles this property returns null.


getStyleIdentifier

public int getStyleIdentifier()
Gets the locale independent style identifier for a built-in style. The value of the property is StyleIdentifier integer constant.

For user defined (custom) styles, this property returns StyleIdentifier.USER.

See Also:
Name

getStyles

public StyleCollection getStyles()
Gets the collection of styles this style belongs to.

getType

public int getType()
Gets the style type (paragraph or character). The value of the property is StyleType integer constant.

Method Detail

clearParaAttrs

public void clearParaAttrs()
Reserved for internal use.

clearRunAttrs

public void clearRunAttrs()
Reserved for internal use.

fetchInheritedParaAttr

public java.lang.Object fetchInheritedParaAttr(int key)
Reserved for internal use.

fetchInheritedRunAttr

public java.lang.Object fetchInheritedRunAttr(int key)
Reserved for internal use.

fetchParaAttr

public java.lang.Object fetchParaAttr(int key)
Reserved for internal use.

getDirectParaAttr

public java.lang.Object getDirectParaAttr(int key)
Reserved for internal use.

getDirectParaAttrsCount

public int getDirectParaAttrsCount()
Reserved for internal use.

getDirectParaKey

public int getDirectParaKey(int index)
Reserved for internal use.

getDirectRunAttr

public java.lang.Object getDirectRunAttr(int key)
Reserved for internal use.

getDirectRunAttrsCount

public int getDirectRunAttrsCount()
Reserved for internal use.

remove

public void remove()
Removes the specified style from the document. Style removal has following effects on the document model:
  • All references to the style are removed from corresponding paragraphs, runs and tables.
  • If base style is removed its formatting is moved to child styles.
  • If style to be deleted has a linked style, then both of these are deleted.

removeParaAttr

public void removeParaAttr(int key)
Reserved for internal use.

removeRunAttr

public void removeRunAttr(int key)
Reserved for internal use.

setParaAttr

public void setParaAttr(int key, java.lang.Object value)
Reserved for internal use.

setRunAttr

public void setRunAttr(int key, java.lang.Object value)
Reserved for internal use.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.