|
ASPOSE home |
java.lang.Objectcom.aspose.words.Lists
public class Lists
A list in a Microsoft Word document is a set of list formatting properties.
The formatting of the lists is stored in the You do not create objects of this class. There is always only one To create a new list based on a predefined list template or based on a list style,
use the To create a new list with formatting identical to an existing list,
use the To make a paragraph bulleted or numbered, you need to apply list formatting
to a paragraph by assigning a To remove list formatting from a paragraph, use the If you know a bit about WordprocessingML, then you might know it defines separate concepts
for "list" and "list definition". This exactly corresponds to how list formatting is stored
in a Microsoft Word document at the low level. List definition is like a "schema" and
list is like an instance of a list definition. To simplify programming model, Aspose.Words hides the distinction between list and list
definition in much the same way like Microsoft Word hides this in its user interface.
This allows you to concentrate more on how you want your document to look like, rather than
building low-level objects to satisfy requirements of the Microsoft Word file format. It is not possible to delete lists once they are created in the current version of Aspose.Words.
This is similar to Microsoft Word where user does not have explicit control over list definitions.
Property Getters/Setters Summary | ||
---|---|---|
int | getCount() | |
Gets the count of numbered and bulleted lists in the document. | ||
Document | getDocument() | |
Gets the owner document. | ||
List | get(int index) | |
Gets a list by index. |
Method Summary | ||
---|---|---|
List | add(Style listStyle) | |
Creates a new list that references a list style and adds it to the collection of lists in the document. | ||
List | add(int template) | |
Creates a new list based on a predefined template and adds it to the collection of lists in the document. | ||
List | addCopy(List srcList) | |
Creates a new list by copying the specified list and adding it to the collection of lists in the document. | ||
List | getListByListId(int listId) | |
Gets a list by a list identifier. | ||
java.util.Iterator | iterator() | |
Gets the enumerator object that will enumerate lists in the document. |
Property Getters/Setters Detail |
---|
getCount | |
public int getCount() |
getDocument | |
public Document getDocument() |
get | |
public List get(int index) |
Method Detail |
---|
iterator | |
public java.util.Iterator iterator() |
add | |
public List add(int template) |
Aspose.Words list templates correspond to the 21 list templates available in the Bullets and Numbering dialog box in Microsoft Word 2003.
All lists created using this method have 9 list levels.
template
- A add | |
public List add(Style listStyle) throws java.lang.Exception |
The newly created list references the list style. If you change the properties of the list style, it is reflected in the properties of the list. Vice versa, if you change the properties of the list, it is reflected in the properties of the list style.
listStyle
- The list style.addCopy | |
public List addCopy(List srcList) throws java.lang.Exception |
The source list can be from any document. If the source list belongs to a different document, a copy of the list is created and added to the current document.
If the source list is a reference to or a definition of a list style, the newly created list is not related to the original list style.
srcList
- The source list to copy from.getListByListId | |
public List getListByListId(int listId) |
You don't normally need to use this method. Most of the time you apply list formatting
to paragraphs just by settings the
listId
- The list identifier.
|
ASPOSE home |