Package org.odftoolkit.simple

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


      link2.setTextContent("New Heading1");
      link2.setURI(new URI("mailto:devin@odftoolkit.org"));
      Assert.assertEquals("mailto:devin@odftoolkit.org", link2.getURI().toString());

      Paragraph para3 = doc.addParagraph("world");
      TextHyperlink link3 = para3.applyHyperlink(new URI("http://odftoolkit.org"));
      link3.setTextContent("new world");
      para3.appendTextContent("_prefix");
      para3.appendTextContent("_nolink", false);
View Full Code Here


  @Test
  public void testAppendNewSection() {
    try {
      TextDocument doc = TextDocument.newTextDocument();
      doc.addParagraph("Paragraph1");
      Section section = doc.appendSection("Section1");
      section.addParagraph("Here's a section.");
      Assert.assertNotNull(section);
      Assert.assertEquals(section.getName(), "Section1");
      Assert.assertEquals(section.getParagraphByIndex(0, true)
View Full Code Here

  @Test
  public void testSetProtectSection() {
    try {
      TextDocument doc = TextDocument.newTextDocument();
      doc.addParagraph("Paragraph1");
      String secName = "Section1";
      Section section = doc.appendSection(secName);
      Assert.assertNotNull(section);

      section.setProtectedWithPassword("12345");
View Full Code Here

      textDocument.getParagraphByIndex(0, false).setTextContent(
          "Above, table in header Standard (bug with getWidth, but the widths are good)");
      Table table = textDocument.getHeader().addTable(1, 8);
      long[] columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);
      textDocument.addParagraph(null);
      textDocument.addParagraph(null);

      textDocument.addParagraph("First table (columns width : demande / result)");
      table = Table.newTable(textDocument, 1, 6);
      columnsWidth = new long[] { 10, 15, 20, 25, 30, -1 };
View Full Code Here

          "Above, table in header Standard (bug with getWidth, but the widths are good)");
      Table table = textDocument.getHeader().addTable(1, 8);
      long[] columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);
      textDocument.addParagraph(null);
      textDocument.addParagraph(null);

      textDocument.addParagraph("First table (columns width : demande / result)");
      table = Table.newTable(textDocument, 1, 6);
      columnsWidth = new long[] { 10, 15, 20, 25, 30, -1 };
      setColumnsWidth(table, columnsWidth);
View Full Code Here

      long[] columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);
      textDocument.addParagraph(null);
      textDocument.addParagraph(null);

      textDocument.addParagraph("First table (columns width : demande / result)");
      table = Table.newTable(textDocument, 1, 6);
      columnsWidth = new long[] { 10, 15, 20, 25, 30, -1 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("Second table");
View Full Code Here

      textDocument.addParagraph("First table (columns width : demande / result)");
      table = Table.newTable(textDocument, 1, 6);
      columnsWidth = new long[] { 10, 15, 20, 25, 30, -1 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("Second table");
      table = Table.newTable(textDocument, 1, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("Third table");
View Full Code Here

      textDocument.addParagraph("Second table");
      table = Table.newTable(textDocument, 1, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("Third table");
      table = Table.newTable(textDocument, 1, 12);
      columnsWidth = new long[] { 5, 8, 10, 11, 7, 7, 26, 12, 19, 19, 41, 3 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("fourth table (left space of 15mm and 10mm space right)");
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);
      conditionField.updateCondition("test_con_variable == \"false\"");
      TextConditionalTextElement textCondEle = (TextConditionalTextElement) conditionField.getOdfElement();
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.