ASPOSE home

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 List object that is stored separately from the paragraphs. The list objects are stored inside a Lists collection. There is a single Lists 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.
ListgetList()
voidsetList(List value)
           Gets or sets the list this paragraph is a member of.
ListLevelgetListLevel()
           Returns the list level object 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

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

isListItem

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

getList/setList

public List getList()

public void setList(List value)
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 ListLevel getListLevel()
Returns the list level object applied to the current paragraph.

Method Detail

applyBulletDefault

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

This is a shorctut 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()
                       throws java.lang.Exception
Starts a new default numbered list and applies it to the paragraph.

This is a shorctut 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

removeNumbers

public void removeNumbers()
                  throws java.lang.Exception
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.


listIndent

public void listIndent()
               throws java.lang.Exception
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()
                throws java.lang.Exception
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.


See Also:
          Wiki - the home page for the Aspose.Words Product Documentation that includes Programmer's Guide, Knowledge Base and other articles.
          Aspose.Words Support Forum - our preferred method of support.
          Aspose.Words Team - contact Aspose.Words Team.


ASPOSE home