Package org.odftoolkit.simple

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


      table = Table.newTable(textDocument, 1, 3);
      columnsWidth = new long[] { 100 };
      setColumnsWidth(table, columnsWidth);
      table.setVerticalMargin(0.25, 0.5);
      textDocument.addParagraph("Above, other table with top space of 0.25cm and bottom spacin of 0.5cm");

      textDocument.addParagraph(null);
      textDocument.addParagraph(null);
      textDocument.addParagraph("below, table in footer Standard (bug with getWidth, but the widths are good)");
      table = textDocument.getFooter().addTable(1, 8);
View Full Code Here


      columnsWidth = new long[] { 100 };
      setColumnsWidth(table, columnsWidth);
      table.setVerticalMargin(0.25, 0.5);
      textDocument.addParagraph("Above, other table with top space of 0.25cm and bottom spacin of 0.5cm");

      textDocument.addParagraph(null);
      textDocument.addParagraph(null);
      textDocument.addParagraph("below, table in footer Standard (bug with getWidth, but the widths are good)");
      table = textDocument.getFooter().addTable(1, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);
View Full Code Here

      VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_con_variable");
      Paragraph varParagraph = doc.addParagraph("test_con_variable:");
      simpleVariableField.updateField("true", varParagraph.getOdfElement());

      // test condition field
      Paragraph newParagraph = doc.addParagraph("Condition Field Test:");
      ConditionField conditionField = Fields.createConditionField(newParagraph.getOdfElement(), "test_con_variable == \"true\"",
          "trueText", "falseText");
      Assert.assertNotNull(conditionField);
     
      conditionField.updateCondition("test_con_variable == \"false\"");
View Full Code Here

      setColumnsWidth(table, columnsWidth);
      table.setVerticalMargin(0.25, 0.5);
      textDocument.addParagraph("Above, other table with top space of 0.25cm and bottom spacin of 0.5cm");

      textDocument.addParagraph(null);
      textDocument.addParagraph(null);
      textDocument.addParagraph("below, table in footer Standard (bug with getWidth, but the widths are good)");
      table = textDocument.getFooter().addTable(1, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);
     
View Full Code Here

   */
  @Test
  public void testReplacewithParagraph() throws Exception {
    doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
    TextDocument sourcedoc = TextDocument.newTextDocument();
    sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
    sourcedoc.addParagraph("Hello2 from source document!");
    sourcedoc.addParagraph("Hello3 from source document!");
   
    search = null;
    // 6 Simple, at the middle of original Paragraph, split original
View Full Code Here

      table.setVerticalMargin(0.25, 0.5);
      textDocument.addParagraph("Above, other table with top space of 0.25cm and bottom spacin of 0.5cm");

      textDocument.addParagraph(null);
      textDocument.addParagraph(null);
      textDocument.addParagraph("below, table in footer Standard (bug with getWidth, but the widths are good)");
      table = textDocument.getFooter().addTable(1, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);
     
      textDocument.save(ResourceUtilities.newTestOutputFile("testColumsWidth.odt"));
View Full Code Here

  @Test
  public void testReplacewithParagraph() throws Exception {
    doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
    TextDocument sourcedoc = TextDocument.newTextDocument();
    sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
    sourcedoc.addParagraph("Hello2 from source document!");
    sourcedoc.addParagraph("Hello3 from source document!");
   
    search = null;
    // 6 Simple, at the middle of original Paragraph, split original
    // Paragraph, insert before the second Paragraph.
View Full Code Here

    try {
      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT));

      // declare simple variable
      VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_con_variable");
      Paragraph varParagraph = doc.addParagraph("test_con_variable:");
      simpleVariableField.updateField("true", varParagraph.getOdfElement());

      // test condition field
      Paragraph newParagraph = doc.addParagraph("Condition Field Test:");
      ConditionField conditionField = Fields.createConditionField(newParagraph.getOdfElement(), "test_con_variable == \"true\"",
View Full Code Here

      VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_con_variable");
      Paragraph varParagraph = doc.addParagraph("test_con_variable:");
      simpleVariableField.updateField("true", varParagraph.getOdfElement());

      // test condition field
      Paragraph newParagraph = doc.addParagraph("Condition Field Test:");
      ConditionField conditionField = Fields.createConditionField(newParagraph.getOdfElement(), "test_con_variable == \"true\"",
          "trueText", "falseText");
      Assert.assertNotNull(conditionField);

      // validate
View Full Code Here

  public void testReplacewithParagraph() throws Exception {
    doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
    TextDocument sourcedoc = TextDocument.newTextDocument();
    sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
    sourcedoc.addParagraph("Hello2 from source document!");
    sourcedoc.addParagraph("Hello3 from source document!");
   
    search = null;
    // 6 Simple, at the middle of original Paragraph, split original
    // Paragraph, insert before the second Paragraph.
    search = new TextNavigation("SIMPLE", doc);
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.