@Test
public void testGetListIterator() {
try {
PresentationDocument presentDoc = PresentationDocument.newPresentationDocument();
Slide slide1 = presentDoc.newSlide(1, "slide1", SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
//title
Textbox titleTextbox = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
Assert.assertNotNull(titleTextbox);
titleTextbox.setTextContent("This is Title");
java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
Assert.assertNotNull(boxList);
Assert.assertEquals(2, boxList.size());
Textbox leftTextbox = boxList.get(0);
List list1 = leftTextbox.addList();
list1.addItem("Test outline1");
list1.addItem("Test outline2");
//
Textbox rightTextbox = boxList.get(1);
Assert.assertNotNull(rightTextbox);
ListDecorator decorator = new NumberDecorator(presentDoc);
rightTextbox.setBackgroundColor(Color.RED);
List list2 = rightTextbox.addList();
list2.addItem("test AAA");
list2.addItem("test BBB");
Iterator iterator = rightTextbox.getListIterator();
while(iterator.hasNext()){
List list = (List)iterator.next();
Assert.assertEquals(2, list.size());
Assert.assertEquals("test AAA", list.getItem(0).toString());
Assert.assertEquals("test BBB", list.getItem(1).toString());
}
//save
presentDoc.save(ResourceUtilities.newTestOutputFile("abc.odp"));
} catch (Exception e) {
Logger.getLogger(TextBoxTest.class.getName()).log(Level.SEVERE, null, e);
Assert.fail();
}