Skip to main content

NumberingListBullet Class

A bullet that allows you to create a numbered list.

Declaration

public class NumberingListBullet extends ListBullet

Remarks

The following code snippet configures numbering bullets for three text paragraphs:

package presentation;

import com.devexpress.docs.presentation.*;

public class App {
    public static void main(String[] args) throws Exception {
        Presentation presentation = new Presentation();
        presentation.getSlides().clear();

        Slide slide = new Slide(SlideLayoutType.BLANK);
        presentation.getSlides().add(slide);

        Shape shape = new Shape(ShapeType.getRectangle(), 30, 30, 2000, 1000);
        slide.getShapes().add(shape);

        // Use a numbering bullet for a text paragraph
        NumberingListBullet n_bullet = new NumberingListBullet(NumberingListBulletFormat.WIDE_BLACK_CIRCLED_NUMBER, (short)2);
        TextParagraph paragraph1 = new TextParagraph();
        paragraph1.getProperties().setListBullet(n_bullet);
        paragraph1.setText("Paragraph 1");
        shape.getTextArea().getParagraphs().add(paragraph1);

        // Use an image bullet for a text paragraph
        ImageListBullet i_bullet = new ImageListBullet();
        try (InputStream stream = Files.newInputStream(Path.of("..\\..\\..\\data\\image.png"))) {
            i_bullet.setImage(new OfficeImage(DXImage.fromStream(stream)));
        }
        TextParagraph paragraph2 = new TextParagraph();
        paragraph2.getProperties().setListBullet(i_bullet);
        paragraph2.setText("Paragraph 2");
        shape.getTextArea().getParagraphs().add(paragraph2);

        // Use a char bullet for a text paragraph
        CharListBullet c_bullet = new CharListBullet('•');
        TextParagraph paragraph3 = new TextParagraph();
        paragraph3.getProperties().setListBullet(c_bullet);
        paragraph3.getProperties().setListBulletColor(new TextBulletColor(new OfficeColor(Color.getRed())));
        paragraph3.setText("Paragraph 3");
        shape.getTextArea().getParagraphs().add(paragraph3);
    }
}

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
OfficeObject
ListBullet
NumberingListBullet

NumberingListBullet(NumberingListBulletFormat format, short startNumber)

Initializes a new instance of the NumberingListBullet class with specified settings.

Declaration

public NumberingListBullet(NumberingListBulletFormat format, short startNumber)

Parameters

Name Type Description
format NumberingListBulletFormat

Specifies the numbering bullet format.

startNumber short

Specifies the starting number for the numbering bullet.

Methods

deepClone() Method

Returns a deep copy of this NumberingListBullet instance.

Declaration

public NumberingListBullet deepClone()

Returns

Type Description
NumberingListBullet

A deep copy of this NumberingListBullet.

getFormat() Method

Returns a value that specifies the numbering bullet format.

Declaration

public NumberingListBulletFormat getFormat()

Returns

Type Description
NumberingListBulletFormat

The numbering bullet format.

getStartNumber() Method

Returns the first number in the numbering list.

Declaration

public short getStartNumber()

Returns

Type Description
short

The first number in the numbering list.