public class List
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable
A list in a Microsoft Word document is a set of list formatting properties. Each list can have up to 9 levels and formatting properties, such as number style, start value, indent, tab position etc are defined separately for each level.
A List object always belongs to the ListCollection collection.
To create a new list, use the Add methods of the ListCollection collection.
To modify formatting of a list, use ListLevel objects found in the getListLevels() collection.
To apply or remove list formatting from a paragraph, use ListFormat.
ListCollection,
ListLevel,
ListFormat| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(List other)
Compares the specified list to the current list.
|
boolean |
equals(List list)
Compares with the specified list.
|
boolean |
equals(java.lang.Object obj) |
DocumentBase |
getDocument()
Gets the owner document.
|
int |
getListId()
Gets the unique identifier of the list.
|
ListLevelCollection |
getListLevels()
Gets the collection of list levels for this list.
|
Style |
getStyle()
Gets the list style that this list references or defines.
|
int |
hashCode() |
boolean |
hasSameTemplate(List other)
Returns true if the current list and the given list are created from the same template.
|
boolean |
isListStyleDefinition()
Returns true if this list is a definition of a list style.
|
boolean |
isListStyleReference()
Returns true if this list is a reference to a list style.
|
boolean |
isMultiLevel()
Returns true when the list contains 9 levels; false when 1 level.
|
boolean |
isRestartAtEachSection()
Specifies whether list should be restarted at each section.
|
void |
isRestartAtEachSection(boolean value)
Specifies whether list should be restarted at each section.
|
protected java.lang.Object |
memberwiseClone() |
public boolean equals(List list)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int getListId()
You do not normally need to use this property. But if you use it, you normally do so in conjunction with the ListCollection.getListByListId(int) method to find a list by its identifier.
public DocumentBase getDocument()
A list always has a parent document and is valid only in the context of that document.
public boolean isMultiLevel()
The lists that you create with Aspose.Words are always multi-level lists and contain 9 levels.
Microsoft Word 2003 and later always create multi-level lists with 9 levels. But in some documents, created with earlier versions of Microsoft Word you might encounter lists that have 1 level only.
public ListLevelCollection getListLevels()
Use this property to access and modify formatting individual to each level of the list.
public boolean isRestartAtEachSection()
This option is supported only in RTF, DOC and DOCX document formats.
This option will be written to DOCX only if OoxmlCompliance is higher then OoxmlCompliance.ECMA_376_2006.
boolean value.public void isRestartAtEachSection(boolean value)
This option is supported only in RTF, DOC and DOCX document formats.
This option will be written to DOCX only if OoxmlCompliance is higher then OoxmlCompliance.ECMA_376_2006.
value - The corresponding boolean value.public boolean isListStyleDefinition()
When this property is true, the getStyle() property returns the list style that this list defines.
By modifying properties of a list that defines a list style, you modify the properties of the list style.
A list that is a definition of a list style cannot be applied directly to paragraphs to make them numbered.
getStyle(),
isListStyleReference()public boolean isListStyleReference()
Note, modifying properties of a list that is a reference to list style has no effect. The list formatting specified in the list style itself always takes precedence.
getStyle(),
isListStyleDefinition()public Style getStyle()
If this list is not associated with a list style, the property will return null.
A list could be a reference to a list style, in this case isListStyleReference() will be true.
A list could be a definition of a list style, in this case isListStyleDefinition() will be true. Such a list cannot be applied to paragraphs in the document directly.
public int compareTo(List other)
public boolean hasSameTemplate(List other)
protected java.lang.Object memberwiseClone()