@Test public void testGetOwnerList() { try { TextDocument odtdoc = (TextDocument) TextDocument.loadDocument(ResourceUtilities .getTestResourceAsStream(SAMPLE_LIST_DOCUMENT)); Iterator<List> listIterator = odtdoc.getListIterator(); if (listIterator.hasNext()) { List list = listIterator.next(); ListItem item = list.getItem(0); List ownerList = item.getOwnerList(); Assert.assertEquals(list.getOdfElement(), ownerList.getOdfElement()); } else { Assert.fail("list iterate fail."); } } catch (Exception e) { Logger.getLogger(ListItemTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }
public List getOwnerList() { Node parent = listItemElement.getParentNode(); if (parent instanceof TextListElement) { return new List((TextListElement) parent); } return null; }
ListItem implements ListContainer { public List getOwnerList() { Node parent = listItemElement.getParentNode(); if (parent instanceof TextListElement) { return new List((TextListElement) parent); } return null; } }
ListItem implements ListContainer { public List getOwnerList() { Node parent = listItemElement.getParentNode(); if (parent instanceof TextListElement) { return new List((TextListElement) parent); } return null; } ListItem(TextListItemElement element);   ListItem(TextListItemElement element, String content); }
ListItem implements ListContainer { public List getOwnerList() { Node parent = listItemElement.getParentNode(); if (parent instanceof TextListElement) { return new List((TextListElement) parent); } return null; } ListItem(TextListItemElement element);   ListItem(TextListItemElement element, String content); TextListItemElement getOdfElement(); String getTextContent(); void setTextContent(String content); void remove(); Integer getStartNumber(); void setStartNumber(Integer number); String getNumberFormat(); void setNumberFormat(String format); int getIndex(); List getOwnerList(); @Override String toString(); OdfElement getListContainerElement(); List addList(); List addList(ListDecorator decorator); void clearList(); Iterator<List> getListIterator(); boolean removeList(List list); }
ListItem implements ListContainer { public List getOwnerList() { Node parent = listItemElement.getParentNode(); if (parent instanceof TextListElement) { return new List((TextListElement) parent); } return null; } ListItem(TextListItemElement element);   ListItem(TextListItemElement element, String content); TextListItemElement getOdfElement(); String getTextContent(); void setTextContent(String content); void remove(); Integer getStartNumber(); void setStartNumber(Integer number); String getNumberFormat(); void setNumberFormat(String format); int getIndex(); List getOwnerList(); @Override String toString(); OdfElement getListContainerElement(); List addList(); List addList(ListDecorator decorator); void clearList(); Iterator<List> getListIterator(); boolean removeList(List list);  }