@Test(expected = IllegalArgumentException.class) public void cannotInsertSiblingAfterAList() { PDOutlineItem child = new PDOutlineItem(); child.insertSiblingAfter(new PDOutlineItem()); child.insertSiblingAfter(new PDOutlineItem()); root.insertSiblingAfter(child); }
public void insertSiblingAfter(PDOutlineItem newSibling) { requireSingleNode(newSibling); PDOutlineNode parent = getParent(); newSibling.setParent(parent); PDOutlineItem next = getNextSibling(); setNextSibling(newSibling); newSibling.setPreviousSibling(this); if (next != null) { newSibling.setNextSibling(next); next.setPreviousSibling(newSibling); } else if (parent != null) { getParent().setLastChild(newSibling); } updateParentOpenCountForAddedChild(newSibling); }
PDOutlineItem extends PDOutlineNode { public void insertSiblingAfter(PDOutlineItem newSibling) { requireSingleNode(newSibling); PDOutlineNode parent = getParent(); newSibling.setParent(parent); PDOutlineItem next = getNextSibling(); setNextSibling(newSibling); newSibling.setPreviousSibling(this); if (next != null) { newSibling.setNextSibling(next); next.setPreviousSibling(newSibling); } else if (parent != null) { getParent().setLastChild(newSibling); } updateParentOpenCountForAddedChild(newSibling); } }
PDOutlineItem extends PDOutlineNode { public void insertSiblingAfter(PDOutlineItem newSibling) { requireSingleNode(newSibling); PDOutlineNode parent = getParent(); newSibling.setParent(parent); PDOutlineItem next = getNextSibling(); setNextSibling(newSibling); newSibling.setPreviousSibling(this); if (next != null) { newSibling.setNextSibling(next); next.setPreviousSibling(newSibling); } else if (parent != null) { getParent().setLastChild(newSibling); } updateParentOpenCountForAddedChild(newSibling); } PDOutlineItem();  PDOutlineItem( COSDictionary dic ); }
PDOutlineItem extends PDOutlineNode { public void insertSiblingAfter(PDOutlineItem newSibling) { requireSingleNode(newSibling); PDOutlineNode parent = getParent(); newSibling.setParent(parent); PDOutlineItem next = getNextSibling(); setNextSibling(newSibling); newSibling.setPreviousSibling(this); if (next != null) { newSibling.setNextSibling(next); next.setPreviousSibling(newSibling); } else if (parent != null) { getParent().setLastChild(newSibling); } updateParentOpenCountForAddedChild(newSibling); } PDOutlineItem();  PDOutlineItem( COSDictionary dic ); void insertSiblingAfter(PDOutlineItem newSibling); void insertSiblingBefore(PDOutlineItem newSibling); PDOutlineItem getPreviousSibling(); PDOutlineItem getNextSibling(); String getTitle(); void setTitle(String title); PDDestination getDestination(); void setDestination(PDDestination dest); void setDestination(PDPage page); PDPage findDestinationPage(PDDocument doc); PDAction getAction(); void setAction( PDAction action ); PDStructureElement getStructureElement(); void setStructuredElement( PDStructureElement structureElement ); PDColor getTextColor(); void setTextColor( PDColor textColor ); void setTextColor( AWTColor textColor ); boolean isItalic(); void setItalic( boolean italic ); boolean isBold(); void setBold( boolean bold ); }
PDOutlineItem extends PDOutlineNode { public void insertSiblingAfter(PDOutlineItem newSibling) { requireSingleNode(newSibling); PDOutlineNode parent = getParent(); newSibling.setParent(parent); PDOutlineItem next = getNextSibling(); setNextSibling(newSibling); newSibling.setPreviousSibling(this); if (next != null) { newSibling.setNextSibling(next); next.setPreviousSibling(newSibling); } else if (parent != null) { getParent().setLastChild(newSibling); } updateParentOpenCountForAddedChild(newSibling); } PDOutlineItem();  PDOutlineItem( COSDictionary dic ); void insertSiblingAfter(PDOutlineItem newSibling); void insertSiblingBefore(PDOutlineItem newSibling); PDOutlineItem getPreviousSibling(); PDOutlineItem getNextSibling(); String getTitle(); void setTitle(String title); PDDestination getDestination(); void setDestination(PDDestination dest); void setDestination(PDPage page); PDPage findDestinationPage(PDDocument doc); PDAction getAction(); void setAction( PDAction action ); PDStructureElement getStructureElement(); void setStructuredElement( PDStructureElement structureElement ); PDColor getTextColor(); void setTextColor( PDColor textColor ); void setTextColor( AWTColor textColor ); boolean isItalic(); void setItalic( boolean italic ); boolean isBold(); void setBold( boolean bold );  }