Examples of WhitespaceProcessor


Examples of org.odftoolkit.simple.common.WhitespaceProcessor

  }

  // Set the text content in this cell. If content is null, it will display
  // the empty string instead.
  private void setDisplayTextContent(String content, String stylename) {
    WhitespaceProcessor textProcessor = new WhitespaceProcessor();
    OdfStylableElement element = OdfElement.findFirstChildNode(OdfTextParagraph.class, mCellElement);
    if (element == null) {
      removeContent();
      element = new OdfTextParagraph((OdfFileDom) mCellElement.getOwnerDocument());
      mCellElement.appendChild(element);
    } else {
      String formerContent = element.getTextContent();
      while (formerContent == null || "".equals(formerContent)) {
        OdfTextSpan span = OdfElement.findFirstChildNode(OdfTextSpan.class, element);
        if (span == null) {
          break;
        }
        formerContent = span.getTextContent();
        element = span;
      }
    }
    if ((stylename != null) && (stylename.length() > 0)) {
      element.setStyleName(stylename);
    }
    element.setTextContent(null);
    textProcessor.append(element, content);
    optimizeCellSize(content);
  }
View Full Code Here

Examples of org.odftoolkit.simple.common.WhitespaceProcessor

  }

  // Set the text content in this cell. If content is null, it will display
  // the empty string instead.
  private void setDisplayTextContent(String content, String stylename) {
    WhitespaceProcessor textProcessor = new WhitespaceProcessor();
    OdfStylableElement element = OdfElement.findFirstChildNode(OdfTextParagraph.class, mCellElement);
    if (element == null) {
      removeContent();
      element = new OdfTextParagraph((OdfFileDom) mCellElement.getOwnerDocument());
      mCellElement.appendChild(element);
    } else {
      String formerContent = element.getTextContent();
      while (formerContent == null || "".equals(formerContent)) {
        OdfTextSpan span = OdfElement.findFirstChildNode(OdfTextSpan.class, element);
        if (span == null) {
          break;
        }
        formerContent = span.getTextContent();
        element = span;
      }
    }
    if ((stylename != null) && (stylename.length() > 0)) {
      element.setStyleName(stylename);
    }
    element.setTextContent(null);
    textProcessor.append(element, content);
    optimizeCellSize(content);
  }
View Full Code Here

Examples of org.odftoolkit.simple.common.WhitespaceProcessor

  }

  // Set the text content in this cell. If content is null, it will display
  // the empty string instead.
  private void setDisplayTextContent(String content, String stylename) {
    WhitespaceProcessor textProcessor = new WhitespaceProcessor();
    OdfStylableElement element = OdfElement.findFirstChildNode(OdfTextParagraph.class, mCellElement);
    if (element == null) {
      removeContent();
      element = new OdfTextParagraph((OdfFileDom) mCellElement.getOwnerDocument());
      mCellElement.appendChild(element);
    } else {
      String formerContent = element.getTextContent();
      while (formerContent == null || "".equals(formerContent)) {
        OdfTextSpan span = OdfElement.findFirstChildNode(OdfTextSpan.class, element);
        if (span == null) {
          break;
        }
        formerContent = span.getTextContent();
        element = span;
      }
    }
    if ((stylename != null) && (stylename.length() > 0)) {
      element.setStyleName(stylename);
    }
    element.setTextContent(null);
    textProcessor.append(element, content);
    optimizeCellSize(content);
  }
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.