}
private class ListContainerImpl extends AbstractListContainer {
public OdfElement getListContainerElement() {
DrawFrameElement frame = null;
DrawTextBoxElement textBox = null;
NodeList frameList = maSlideElement.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), "frame");
if (frameList.getLength() > 0) {
int index = frameList.getLength() - 1;
while (index >= 0) {
frame = (DrawFrameElement) frameList.item(index);
String presentationClass = frame.getPresentationClassAttribute();
if (presentationClass == null || "outline".equals(presentationClass)
|| "text".equals(presentationClass) || "subtitle".equals(presentationClass)) {
break;
} else {
index--;
}
frame = null;
}
}
if (frame == null) {
throw new UnsupportedOperationException(
"There is no list container in this slide, please chose a proper slide layout.");
}
NodeList textBoxList = frame.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), "text-box");
if (textBoxList.getLength() <= 0) {
textBox = frame.newDrawTextBoxElement();
} else {
textBox = (DrawTextBoxElement) textBoxList.item(textBoxList.getLength() - 1);
}
return textBox;
}