com.aspose.words
Class ListFormat

java.lang.Object
    extended by com.aspose.words.ListFormat

public class ListFormat 
extends java.lang.Object

Allows to control what list formatting is applied to a paragraph.

A paragraph in a Microsoft Word document can be bulleted or numbered. When a paragraph is bulleted or numbered, it is said that list formatting is applied to the paragraph.

You do not create objects of the ListFormat class directly. You access ListFormat as a property of another object that can have list formatting associated with it. At the moment the objects that can have list formatting are: Paragraph, Style and DocumentBuilder.

ListFormat of a Paragraph specifies what list formatting and list level is applied to that particular paragraph.

ListFormat of a Style (applicable to paragraph styles only) allows to specify what list formatting and list level is applied to all paragraphs of that particular style.

ListFormat of a DocumentBuilder provides access to the list formatting at the current cursor position inside the DocumentBuilder.

The list formatting itself is stored inside a Aspose.Words.Lists.List object that is stored separately from the paragraphs. The list objects are stored inside a Aspose.Words.Lists.ListCollection collection. There is a single Aspose.Words.Lists.ListCollection collection per Document.

The paragraphs do not physically belong to a list. The paragraphs just reference a particular list object via the List property and a particular level in the list via the ListLevelNumber property. By setting these two properties you control what bullets and numbering is applied to a paragraph.


Property Getters/Setters Summary
booleanisListItem()
           True when the paragraph has bulleted or numbered formatting applied to it.
Aspose.Words.Lists.ListgetList()
           Gets or sets the list this paragraph is a member of.
Aspose.Words.Lists.ListLevelgetListLevel()
           Returns the list level formatting plus any formatting overrides applied to the current paragraph.
intgetListLevelNumber()
voidsetListLevelNumber(int value)
           Gets or sets the list level number (0 to 8) for the paragraph.
 
Method Summary
voidapplyBulletDefault()
           Starts a new default bulleted list and applies it to the paragraph.
voidapplyNumberDefault()
           Starts a new default numbered list and applies it to the paragraph.
voidlistIndent()
           Increases the list level of the current paragraph by one level.
voidlistOutdent()
           Decreases the list level of the current paragraph by one level.
voidremoveNumbers()
           Removes numbers or bullets from the current paragraph and sets list level to zero.
 

Property Getters/Setters Detail

isListItem

public boolean isListItem()
True when the paragraph has bulleted or numbered formatting applied to it.

getList

public Aspose.Words.Lists.List getList()
Gets or sets the list this paragraph is a member of.

The list that is being assigned to this property must belong to the current document.

The list that is being assigned to this property must not be a list style definition.

Setting this property to null removes bullets and numbering from the paragraph and sets the list level number to zero. Setting this property to null is equivalent to calling removeNumbers().

See Also:
ListLevelNumber, removeNumbers()

getListLevel

public Aspose.Words.Lists.ListLevel getListLevel()
Returns the list level formatting plus any formatting overrides applied to the current paragraph.

getListLevelNumber/setListLevelNumber

public int getListLevelNumber() / public void setListLevelNumber(int value)
Gets or sets the list level number (0 to 8) for the paragraph.

In Word documents, lists may consist of 1 or 9 levels, numbered 0 to 8.

Has effect only when the List property is set to reference a valid list.

See Also:
List

Method Detail

applyBulletDefault

public void applyBulletDefault()
Starts a new default bulleted list and applies it to the paragraph.

This is a shortcut method that creates a new list using the default bulleted template, applies it to the paragraph and selects the 1st list level.

See Also:
List, removeNumbers(), ListLevelNumber

applyNumberDefault

public void applyNumberDefault()
Starts a new default numbered list and applies it to the paragraph.

This is a shortcut method that creates a new list using the default numbered template, applies it to the paragraph and selects the 1st list level.

See Also:
List, removeNumbers(), ListLevelNumber

listIndent

public void listIndent()
Increases the list level of the current paragraph by one level.

This method changes the list level and applies formatting properties of the new level.

In Word documents, lists may consist of up to nine levels. List formatting for each level specifies what bullet or number is used, left indent, space between the bullet and text etc.


listOutdent

public void listOutdent()
Decreases the list level of the current paragraph by one level.

This method changes the list level and applies formatting properties of the new level.

In Word documents, lists may consist of up to nine levels. List formatting for each level specifies what bullet or number is used, left indent, space between the bullet and text etc.


removeNumbers

public void removeNumbers()
Removes numbers or bullets from the current paragraph and sets list level to zero.

Calling this method is equivalent to setting the List property to null.


See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.