com.aspose.words

Class ListTrailingCharacter

  • java.lang.Object
    • com.aspose.words.ListTrailingCharacter
public class ListTrailingCharacter 
extends java.lang.Object

Utility class containing constants. Specifies the character that separates the list label from the text of the paragraph.

Used as a value for the ListLevel.TrailingCharacter property.

Example:

Shows how to apply custom list formatting to paragraphs when using DocumentBuilder.
Document doc = new Document();

// Create a list based on one of the Microsoft Word list templates.
List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);

// Completely customize one list level.
ListLevel level1 = list.getListLevels().get(0);
level1.getFont().setColor(Color.RED);
level1.getFont().setSize(24);
level1.setNumberStyle(NumberStyle.ORDINAL_TEXT);
level1.setStartAt(21);
level1.setNumberFormat("\u0000");

level1.setNumberPosition(-36);
level1.setTextPosition(144);
level1.setTabPosition(144);

// Completely customize yet another list level.
ListLevel level2 = list.getListLevels().get(1);
level2.setAlignment(ListLevelAlignment.RIGHT);
level2.setNumberStyle(NumberStyle.BULLET);
level2.getFont().setName("Wingdings");
level2.getFont().setColor(Color.BLUE);
level2.getFont().setSize(24);
level2.setNumberFormat("\uf0af");    // A bullet that looks like some sort of a star.
level2.setTrailingCharacter(ListTrailingCharacter.SPACE);
level2.setNumberPosition(144);

// Now add some text that uses the list that we created.
// It does not matter when to customize the list - before or after adding the paragraphs.
DocumentBuilder builder = new DocumentBuilder(doc);

builder.getListFormat().setList(list);
builder.writeln("The quick brown fox...");
builder.writeln("The quick brown fox...");

builder.getListFormat().listIndent();
builder.writeln("jumped over the lazy dog.");
builder.writeln("jumped over the lazy dog.");

builder.getListFormat().listOutdent();
builder.writeln("The quick brown fox...");

builder.getListFormat().removeNumbers();

builder.getDocument().save(getMyDir() + "\\Artifacts\\Lists.CreateCustomList.doc");

Field Summary
static final intTAB = 0
A tab character is placed between the list label and text of the paragraph.
static final intSPACE = 1
A space character is placed between the list label and text of the paragraph.
static final intNOTHING = 2
There is no separator character between the list label and text of the paragraph.
 

    • Field Detail

      • TAB = 0

        public static final int TAB
        A tab character is placed between the list label and text of the paragraph.
      • SPACE = 1

        public static final int SPACE
        A space character is placed between the list label and text of the paragraph.
      • NOTHING = 2

        public static final int NOTHING
        There is no separator character between the list label and text of the paragraph.