Package org.odftoolkit.simple

Examples of org.odftoolkit.simple.TextDocument.newParagraph()


      TextDocument document = TextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      createEmptyTable(document);

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
      document.newParagraph();
      document.newParagraph("Table with string values:");
      createTableWithString(document);
View Full Code Here


      createEmptyTable(document);

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
      document.newParagraph();
      document.newParagraph("Table with string values:");
      createTableWithString(document);

      document.save(ResourceUtilities.newTestOutputFile("CreateTableCase.odt"));
    } catch (Exception e) {
View Full Code Here

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
      document.newParagraph();
      document.newParagraph("Table with string values:");
      createTableWithString(document);

      document.save(ResourceUtilities.newTestOutputFile("CreateTableCase.odt"));
    } catch (Exception e) {
      Logger.getLogger(TableTest.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here

  @Test
  public void testSetGetWidth() {
    long width = 500;
    try {
      TextDocument document = TextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      Table table = createEmptyTable(document);
      table.setWidth(width);
      Assert.assertTrue(Math.abs(width - table.getWidth()) < 3);

      document.save(ResourceUtilities.newTestOutputFile("TestSetGetWidth.odt"));
View Full Code Here

  public void testGetSetTablename() {
    String tablename = "My Table";
    TextDocument document = null;
    try {
      document = TextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      Table table = createEmptyTable(document);
      table.setTableName(tablename);
      Assert.assertEquals(tablename, table.getTableName());

      document.save(ResourceUtilities.newTestOutputFile("TestGetSetName.odt"));
View Full Code Here

      ListDecorator numberDecorator = new NumberDecorator(doc);
      ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
      ListDecorator outLineDecorator = new OutLineDecorator(doc);
      String[] subItemContents = { "sub list item 1", "sub list item 2", "sub list item 3" };

      doc.newParagraph(" ");
      doc.newParagraph("Bullet List:");
      List bulletList = doc.addList(bulletDecorator);
      bulletList.setHeader("Bullet List Header1\nBullet List Header2");
      bulletList.addItem("bullet item1");
      bulletList.addItem("bullet item2");
View Full Code Here

      ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
      ListDecorator outLineDecorator = new OutLineDecorator(doc);
      String[] subItemContents = { "sub list item 1", "sub list item 2", "sub list item 3" };

      doc.newParagraph(" ");
      doc.newParagraph("Bullet List:");
      List bulletList = doc.addList(bulletDecorator);
      bulletList.setHeader("Bullet List Header1\nBullet List Header2");
      bulletList.addItem("bullet item1");
      bulletList.addItem("bullet item2");
      ListItem item = bulletList.addItem("item3 with a bullet list");
View Full Code Here

      List subList = item.addList();
      subList.addItems(subItemContents);
      bulletList.addItem("bullet item4");
      Assert.assertEquals(ListType.BULLET, bulletList.getType());

      doc.newParagraph(" ");
      doc.newParagraph("Number List:");
      List numberList = doc.addList(numberDecorator);
      numberList.setHeader("Number List Header");
      numberList.addItem("number item1");
      item = numberList.addItem("number item2");
View Full Code Here

      subList.addItems(subItemContents);
      bulletList.addItem("bullet item4");
      Assert.assertEquals(ListType.BULLET, bulletList.getType());

      doc.newParagraph(" ");
      doc.newParagraph("Number List:");
      List numberList = doc.addList(numberDecorator);
      numberList.setHeader("Number List Header");
      numberList.addItem("number item1");
      item = numberList.addItem("number item2");
      subList = item.addList(numberDecorator);
View Full Code Here

      numberList.addItem("number item3");
      Assert.assertEquals(ListType.NUMBER, numberList.getType());
      numberList.setDecorator(bulletDecorator);
      Assert.assertEquals(ListType.BULLET, numberList.getType());

      doc.newParagraph(" ");
      doc.newParagraph("Image List:");
      List imageList = doc.addList(imageDecorator);
      item = imageList.addItem("image item1");
      subList = item.addList(imageDecorator);
      subList.addItems(subItemContents);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.