AbstractTextboxContainer extends AbstractFrameContainer implements TextboxContainer { public boolean removeTextbox(Textbox box) { OdfElement containerElement = getFrameContainerElement(); DrawFrameElement drawFrame = box.getDrawFrameElement(); try { drawFrame.removeChild(box.getOdfElement()); if (drawFrame.hasChildNodes() == false) containerElement.removeChild(box.getDrawFrameElement()); } catch (DOMException exception) { Logger.getLogger(AbstractParagraphContainer.class.getName()).log(Level.WARNING, exception.getMessage()); return false; } return true; }  Textbox addTextbox(); boolean removeTextbox(Textbox box); Iterator<Textbox> getTextboxIterator(); Textbox addTextbox(FrameRectangle position); Textbox getTextboxByName(String name); List<Textbox> getTextboxByUsage(PresentationDocument.PresentationClass usage);  }
@Test public void testRemoveTextbox() { try { PresentationDocument pDoc = PresentationDocument.newPresentationDocument(); Slide slide = pDoc.newSlide(0, "slide name ", SlideLayout.TITLE_OUTLINE); java.util.List<Textbox> listTbox = slide.getTextboxByUsage(PresentationClass.TITLE); Textbox titleBox = listTbox.get(0); titleBox.setBackgroundColor(Color.BLUE); titleBox.setName("title"); titleBox.setTextContent("this is title"); Textbox tbox = slide.getTextboxByName("title"); Assert.assertEquals(titleBox, tbox); slide.removeTextbox(titleBox); Textbox tbox1 = slide.getTextboxByName("title"); Assert.assertNull(tbox1); pDoc.save(ResourceUtilities.newTestOutputFile("imagep.odp")); } catch (Exception e) { Logger.getLogger(AbstractTextboxContainerTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(); } }