java.lang.Objectcom.aspose.words.StyleCollection
public class StyleCollection
Property Getters/Setters Summary | ||
---|---|---|
int | getCount() | |
Gets the number of styles in the collection. | ||
Font | getDefaultFont() | |
Gets document default text formatting. | ||
ParagraphFormat | getDefaultParagraphFormat() | |
Gets document default paragraph formatting. | ||
DocumentBase | getDocument() | |
Gets the owner document. | ||
Style | get(int index) | |
Gets a style by index. | ||
Style | get(java.lang.String name) | |
Gets a style by name or alias. | ||
Style | getByStyleIdentifier(int sti) | |
Gets a built-in style by its locale independent identifier. |
Method Summary | ||
---|---|---|
Style | add(int type, java.lang.String name) | |
Creates a new user defined style and adds it the collection. | ||
Style | addCopy(Style style) | |
Copies a style into this collection. | ||
java.util.Iterator | iterator() | |
Gets an enumerator object that will enumerate styles in the alphabetical order of their names. |
Property Getters/Setters Detail |
---|
getCount | |
public int getCount() |
getDefaultFont | |
public Font getDefaultFont() |
Note that document-wide defaults were introduced in Microsoft Word 2007 and are fully supported in OOXML formats (
getDefaultParagraphFormat | |
public ParagraphFormat getDefaultParagraphFormat() |
Note that document-wide defaults were introduced in Microsoft Word 2007 and are fully supported in OOXML formats (
getDocument | |
public DocumentBase getDocument() |
get | |
public Style get(int index) |
get | |
public Style get(java.lang.String name) |
Case sensitive, returns null if the style with the given name is not found.
If this is an English name of a built in style that does not yet exist, automatically creates it.
getByStyleIdentifier | |
public Style getByStyleIdentifier(int sti) |
When accessing a style that does not yet exist, automatically creates it.
sti
- A Method Detail |
---|
add | |
public Style add(int type, java.lang.String name) |
You can create character, paragraph or a list style.
When creating a list style, the style is created with default numbered list formatting (1 \ a \ i).
Throws an exception if a style with this name already exists.
type
- A name
- Case sensitive name of the style to create.addCopy | |
public Style addCopy(Style style) |
Style to be copied can belong to the same document as well as to different document.
Linked style is copied.
This method does doesn't copy base styles.
If collection already contains a style with the same name, then new name is
automatically generated by adding "_number" suffix starting from 0 e.g. "Normal_0", "Heading 1_1" etc.
Use
style
- Style to be copied.iterator | |
public java.util.Iterator iterator() |