StyleCollection

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

NameTypeAccessDescription
documentDocumentBaseReadGets the owner document.
defaultFontFontReadGets document default text formatting.
defaultParagraphFormatParagraphFormatReadGets document default paragraph formatting.
countintReadGets the number of styles in the collection.

Methods

SignatureDescription
clearQuickStyleGallery()Removes all styles from the Quick Style Gallery panel.
getDocument() → DocumentBaseGets the owner document.
getDefaultFont() → FontGets document default text formatting.
getDefaultParagraphFormat() → ParagraphFormatGets document default paragraph formatting.
getCount() → intGets the number of styles in the collection.
get(name: String) → StyleGets a style by name or alias.
getByStyleIdentifier(sti: int) → StyleGets a built-in style by its locale independent identifier.
get(index: int) → StyleGets 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) → StyleCreates a new user defined style and adds it the collection.
addCopy(style: Style) → StyleCopies a style into this collection.

See Also