StyleCollection
Overview
StyleCollection is a class in Aspose.Words FOSS for Java.
Inherits from: Iterable<Style>, Cloneable.
A collection of Style objects that represent both the built-in and user-defined styles in a document.
Edition status of its 14 listed members (a property and its accessor methods are listed separately, overloads once): 14 not yet exercised by a verified example.
This class declares 11 methods for StyleCollection objects in Java programs.
Available methods include: add, addCopy, clearQuickStyleGallery, get, getByStyleIdentifier, getCount, getDefaultFont, getDefaultParagraphFormat, getDocument, iterator.
Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package.
Properties: count, defaultFont, defaultParagraphFormat, document.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
document | DocumentBase | Read | Gets the owner document. |
defaultFont | Font | Read | Gets document default text formatting. |
defaultParagraphFormat | ParagraphFormat | Read | Gets document default paragraph formatting. |
count | int | Read | Gets the number of styles in the collection. |
Methods
| Signature | Description |
|---|---|
clearQuickStyleGallery() | Removes all styles from the Quick Style Gallery panel. |
getDocument() → DocumentBase | Gets the owner document. |
getDefaultFont() → Font | Gets document default text formatting. |
getDefaultParagraphFormat() → ParagraphFormat | Gets document default paragraph formatting. |
getCount() → int | Gets the number of styles in the collection. |
get(name: String) → Style | Gets a style by name or alias. |
getByStyleIdentifier(sti: int) → Style | Gets a built-in style by its locale independent identifier. |
get(index: int) → Style | Gets a style by index. |
iterator() → Iterator<Style> | Gets an enumerator object that will enumerate styles in the alphabetical order of their names. |
add(type: int, name: String) → Style | Creates a new user defined style and adds it the collection. |
addCopy(style: Style) → Style | Copies a style into this collection. |