ListDecorator numberDecorator = new NumberDecorator(doc);
ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
String[] numberItemContents = { "number item 1", "number item 2", "number item 3" };
// add list.
ListContainer container = doc.newSlide(0, "test0", Slide.SlideLayout.TITLE_OUTLINE);
org.odftoolkit.simple.text.list.List bulletList = container.addList(bulletDecorator);
bulletList.addItems(numberItemContents);
container = doc.newSlide(1, "test1", Slide.SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
org.odftoolkit.simple.text.list.List numberList = container.addList(numberDecorator);
numberList.addItems(numberItemContents);
container = doc.newSlide(2, "test2", Slide.SlideLayout.TITLE_PLUS_TEXT);
org.odftoolkit.simple.text.list.List imageList = container.addList(imageDecorator);
imageList.addItems(numberItemContents);
// iterate list
Assert.assertTrue(container.getListIterator().hasNext());
// remove list
container.clearList();
Assert.assertFalse(container.getListIterator().hasNext());
} catch (Exception e) {
LOG.log(Level.SEVERE, null, e);
Assert.fail(e.getMessage());
}
}