Package org.odftoolkit.odfdom.dom.element.text

Examples of org.odftoolkit.odfdom.dom.element.text.TextTableOfContentSourceElement


      OdfContentDom content = getContentDom();
      textTableOfContent = content
          .newOdfElement(TextTableOfContentElement.class);
      textTableOfContent.setTextNameAttribute("Table of Contents");
      textTableOfContent.setTextProtectedAttribute(true);
      TextTableOfContentSourceElement textTableOfContentSource = textTableOfContent
          .newTextTableOfContentSourceElement();
      textTableOfContentSource.setTextOutlineLevelAttribute(10);
      textTableOfContentSource.setTextUseIndexMarksAttribute(true);
      TextIndexTitleTemplateElement textIndexTitleTemplate = textTableOfContentSource
          .newTextIndexTitleTemplateElement();
      textIndexTitleTemplate
          .setTextStyleNameAttribute("Contents_20_Heading");
      textIndexTitleTemplate.setTextContent("Table of Contents");
      for (int i = 1; i <= 10; i++) {
        TextTableOfContentEntryTemplateElement textTableOfContentEntryTemplate = textTableOfContentSource
            .newTextTableOfContentEntryTemplateElement(i,
                "Contents_20_" + i);
        TextIndexEntryLinkStartElement TextIndexEntryLinkStart = textTableOfContentEntryTemplate
            .newTextIndexEntryLinkStartElement();
        TextIndexEntryLinkStart
View Full Code Here


      textTableOfContent = content
          .newOdfElement(TextTableOfContentElement.class);
      textTableOfContent.setTextNameAttribute("Table of Contents");
      textTableOfContent.setTextProtectedAttribute(true);

      TextTableOfContentSourceElement textTableOfContentSource = textTableOfContent
          .newTextTableOfContentSourceElement();
      textTableOfContentSource.setTextOutlineLevelAttribute(10);
      textTableOfContentSource.setTextUseIndexMarksAttribute(true);
      textTableOfContentSource.setTextUseIndexSourceStylesAttribute(true);
      TextIndexTitleTemplateElement textIndexTitleTemplate = textTableOfContentSource
          .newTextIndexTitleTemplateElement();
      textIndexTitleTemplate
          .setTextStyleNameAttribute("Contents_20_Heading");
      textIndexTitleTemplate.setTextContent("Table of Contents");
      for (int i = 1; i <= 10; i++) {
        TextTableOfContentEntryTemplateElement textTableOfContentEntryTemplate = textTableOfContentSource
            .newTextTableOfContentEntryTemplateElement(i,
                "Contents_20_" + i);
        TextIndexEntryLinkStartElement TextIndexEntryLinkStart = textTableOfContentEntryTemplate
            .newTextIndexEntryLinkStartElement();
        TextIndexEntryLinkStart
            .setTextStyleNameAttribute("Index_20_Link");
        textTableOfContentEntryTemplate
            .newTextIndexEntryChapterElement();
        textTableOfContentEntryTemplate.newTextIndexEntryTextElement();
        TextIndexEntryTabStopElement TextIndexEntryTabStop = textTableOfContentEntryTemplate
            .newTextIndexEntryTabStopElement("right");
        TextIndexEntryTabStop.setStyleLeaderCharAttribute(".");
        textTableOfContentEntryTemplate
            .newTextIndexEntryPageNumberElement();
        textTableOfContentEntryTemplate
            .newTextIndexEntryLinkEndElement();
      }

      if (!tocstyleList.isEmpty()) {
        Set<Integer> key = tocstyleList.keySet();
        Iterator<Integer> it = key.iterator();
        while (it.hasNext()) {
          Integer textOutlineLevelValue = it.next();
          String textStyleNameValue = tocstyleList
              .get(textOutlineLevelValue);
          TextIndexSourceStylesElement textIndexSourceStyles = textTableOfContentSource
              .newTextIndexSourceStylesElement(textOutlineLevelValue);
          textIndexSourceStyles
              .newTextIndexSourceStyleElement(textStyleNameValue);
        }
      }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.text.TextTableOfContentSourceElement

Copyright © 2018 www.massapicom. 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.