Package org.odftoolkit.odfdom.dom.element.meta

Examples of org.odftoolkit.odfdom.dom.element.meta.MetaKeywordElement


   * <p>
   * <code>null</code>, if the element is not set.
   */
  public List<String> getKeywords() {
    List<String> keywords = new ArrayList<String>();
    MetaKeywordElement keywordEle = OdfElement.findFirstChildNode(
        MetaKeywordElement.class, mOfficeMetaElement);
    if (keywordEle != null) {
      keywords.add(keywordEle.getTextContent());
      MetaKeywordElement keywordNext;
      while ((keywordNext = OdfElement.findNextChildNode(
          MetaKeywordElement.class, keywordEle)) != null) {
        keywords.add(keywordNext.getTextContent());
        keywordEle = keywordNext;
      }
      return keywords;
    } else {
      return null;
View Full Code Here


   * meta:keyword}.
   *
   * @param keyList set the specified list of keywords
   */
  public void setKeywords(List<String> keyList) {
    MetaKeywordElement keywordEle = OdfElement.findFirstChildNode(
        MetaKeywordElement.class, mOfficeMetaElement);
    List<MetaKeywordElement> toBeDeleted = new ArrayList<MetaKeywordElement>();
    if (keywordEle != null) {
      MetaKeywordElement keywordTmp;
      toBeDeleted.add(keywordEle);
      while ((keywordTmp = OdfElement.findNextChildNode(
          MetaKeywordElement.class, keywordEle)) != null) {
        keywordEle = keywordTmp;
        toBeDeleted.add(keywordTmp);
      }

    }

    // remove the original
    for (MetaKeywordElement keyele : toBeDeleted) {
      mOfficeMetaElement.removeChild(keyele);
    }
    // add new
    for (int i = 0; i < keyList.size(); i++) {
      MetaKeywordElement keywordElement = mOfficeMetaElement.newMetaKeywordElement();
      keywordElement.setTextContent(keyList.get(i));
    }

  }
View Full Code Here

   *
   * @param keyword  the value of child element {@odf.element
   *            meta:keyword}.
   */
  public void addKeyword(String keyword) {
    MetaKeywordElement keywordElement = mOfficeMetaElement.newMetaKeywordElement();
    keywordElement.setTextContent(keyword);
  }
View Full Code Here

   * <p>
   * <code>null</code>, if the element is not set.
   */
  public List<String> getKeywords() {
    List<String> keywords = new ArrayList<String>();
    MetaKeywordElement keywordEle = OdfElement.findFirstChildNode(
        MetaKeywordElement.class, mOfficeMetaElement);
    if (keywordEle != null) {
      keywords.add(keywordEle.getTextContent());
      MetaKeywordElement keywordNext;
      while ((keywordNext = OdfElement.findNextChildNode(
          MetaKeywordElement.class, keywordEle)) != null) {
        keywords.add(keywordNext.getTextContent());
        keywordEle = keywordNext;
      }
      return keywords;
    } else {
      return null;
View Full Code Here

   * meta:keyword}.
   *
   * @param keyList set the specified list of keywords
   */
  public void setKeywords(List<String> keyList) {
    MetaKeywordElement keywordEle = OdfElement.findFirstChildNode(
        MetaKeywordElement.class, mOfficeMetaElement);
    List<MetaKeywordElement> toBeDeleted = new ArrayList<MetaKeywordElement>();
    if (keywordEle != null) {
      MetaKeywordElement keywordTmp;
      toBeDeleted.add(keywordEle);
      while ((keywordTmp = OdfElement.findNextChildNode(
          MetaKeywordElement.class, keywordEle)) != null) {
        keywordEle = keywordTmp;
        toBeDeleted.add(keywordTmp);
      }

    }

    // remove the original
    for (MetaKeywordElement keyele : toBeDeleted) {
      mOfficeMetaElement.removeChild(keyele);
    }
    // add new
    for (int i = 0; i < keyList.size(); i++) {
      MetaKeywordElement keywordElement = mOfficeMetaElement.newMetaKeywordElement();
      keywordElement.setTextContent(keyList.get(i));
    }

  }
View Full Code Here

   *
   * @param keyword  the value of child element {@odf.element
   *            meta:keyword}.
   */
  public void addKeyword(String keyword) {
    MetaKeywordElement keywordElement = mOfficeMetaElement.newMetaKeywordElement();
    keywordElement.setTextContent(keyword);
  }
View Full Code Here

   * <code>null</code>, if the element is not set.
   * @see org.odftoolkit.odfdom.dom.element.meta.MetaKeywordElement.
   */
  public List<String> getKeywords() {
    List<String> keywords = new ArrayList<String>();
    MetaKeywordElement keywordEle = OdfElement.findFirstChildNode(
        MetaKeywordElement.class, mOfficeMetaElement);
    if (keywordEle != null) {
      keywords.add(keywordEle.getTextContent());
      MetaKeywordElement keywordNext;
      while ((keywordNext = OdfElement.findNextChildNode(
          MetaKeywordElement.class, keywordEle)) != null) {
        keywords.add(keywordNext.getTextContent());
        keywordEle = keywordNext;
      }
      return keywords;
    } else {
      return null;
View Full Code Here

   *
   * @param keyList set the specified list of keywords.
   * @see org.odftoolkit.odfdom.dom.element.meta.MetaKeywordElement.
   */
  public void setKeywords(List<String> keyList) {
    MetaKeywordElement keywordEle = OdfElement.findFirstChildNode(
        MetaKeywordElement.class, mOfficeMetaElement);
    List<MetaKeywordElement> toBeDeleted = new ArrayList<MetaKeywordElement>();
    if (keywordEle != null) {
      MetaKeywordElement keywordTmp;
      toBeDeleted.add(keywordEle);
      while ((keywordTmp = OdfElement.findNextChildNode(
          MetaKeywordElement.class, keywordEle)) != null) {
        keywordEle = keywordTmp;
        toBeDeleted.add(keywordTmp);
      }

    }

    // remove the original
    for (MetaKeywordElement keyele : toBeDeleted) {
      mOfficeMetaElement.removeChild(keyele);
    }
    // add new
    for (int i = 0; i < keyList.size(); i++) {
      MetaKeywordElement keywordElement = mOfficeMetaElement.newMetaKeywordElement();
      keywordElement.setTextContent(keyList.get(i));
    }

  }
View Full Code Here

   *
   * @param keyword  the value of child element <code>MetaKeywordElement</code>.
   * @see org.odftoolkit.odfdom.dom.element.meta.MetaKeywordElement.
   */
  public void addKeyword(String keyword) {
    MetaKeywordElement keywordElement = mOfficeMetaElement.newMetaKeywordElement();
    keywordElement.setTextContent(keyword);
  }
View Full Code Here

   * Child element is new in Odf 1.2
   *
   * @return the element {@odf.element meta:keyword}
   */
  public MetaKeywordElement newMetaKeywordElement() {
    MetaKeywordElement metaKeyword = ((OdfFileDom) this.ownerDocument).newOdfElement(MetaKeywordElement.class);
    this.appendChild(metaKeyword);
    return metaKeyword;
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.meta.MetaKeywordElement

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.