Examples of OdfDefaultStyle


Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

   * @param styleName
   *            - the style name
   * @return a readable style element
   */
  protected OdfStyleBase getReadableStyleElementByName(String styleName) {
    OdfDefaultStyle defaultStyleElement = null;
    if (styleName == null || (styleName.equals(""))) {
      // get from default style element
      defaultStyleElement = mDocument.getDocumentStyles().getDefaultStyle(mOdfElement.getStyleFamily());
      isUseDefaultStyle = true;
      return defaultStyleElement;
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

   * @return a writable style element
   */
  protected OdfStyle getWritableStyleElementByName(String styleName, boolean isShared) {
    boolean createNew = isShared;
    OdfStyle styleElement = null;
    OdfDefaultStyle defaultStyleElement = null;
    if (styleName == null || (styleName.equals(""))) {
      createNew = true;
      // get from default style element
      defaultStyleElement = mDocument.getDocumentStyles().getDefaultStyle(mOdfElement.getStyleFamily());
    } else {
      OdfOfficeAutomaticStyles styles = mOdfElement.getAutomaticStyles();
      styleElement = styles.getStyle(styleName, mOdfElement.getStyleFamily());

      // If not default cell style definition,
      // Try to find if the style is defined in document styles
      if (styleElement == null && defaultStyleElement == null) {
        styleElement = mDocument.getDocumentStyles().getStyle(styleName, mOdfElement.getStyleFamily());
      }

      if (styleElement == null && defaultStyleElement == null) {
        styleElement = mOdfElement.getDocumentStyle();
      }
      if (styleElement == null || styleElement.getStyleUserCount() > 1) {
        createNew = true;
      }
    }
    // if style name is null or this style are used by many users,
    // should create a new one.
    if (createNew) {
      OdfStyle newStyle = mOdfElement.getAutomaticStyles().newStyle(mOdfElement.getStyleFamily());
      if (styleElement != null) {
        newStyle.setProperties(styleElement.getStylePropertiesDeep());
        // copy attributes
        NamedNodeMap attributes = styleElement.getAttributes();
        for (int i = 0; i < attributes.getLength(); i++) {
          Node attr = attributes.item(i);
          if (!attr.getNodeName().equals("style:name")) {
            newStyle.setAttributeNS(attr.getNamespaceURI(), attr.getNodeName(), attr.getNodeValue());
          }
        }// end of copying attributes
      } else if (defaultStyleElement != null) {
        newStyle.setProperties(defaultStyleElement.getStylePropertiesDeep());
        // copy attributes
        NamedNodeMap attributes = defaultStyleElement.getAttributes();
        for (int i = 0; i < attributes.getLength(); i++) {
          Node attr = attributes.item(i);
          if (!attr.getNodeName().equals("style:name")) {
            newStyle.setAttributeNS(attr.getNamespaceURI(), attr.getNodeName(), attr.getNodeValue());
          }
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

      } else {
        parentStyle = getParentStyle((OdfStyle) parentStyle);
      }
    }
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getParagraphDefaultStyle();
      TextProperties defaultStyleSetting = TextProperties.getTextProperties(defaultStyle);
      country = defaultStyleSetting.getCountry(type);
    }
    return country;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

      } else {
        parentStyle = getParentStyle((OdfStyle) parentStyle);
      }
    }
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getParagraphDefaultStyle();
      if (defaultStyle == null) {
        defaultStyle = getParagraphDefaultStyle();
      }
      if (defaultStyle != null) {
        TextProperties defaultStyleSetting = TextProperties.getTextProperties(defaultStyle);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

      } else {
        parentStyle = getParentStyle((OdfStyle) parentStyle);
      }
    }
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getParagraphDefaultStyle();
      TextProperties defaultStyleSetting = TextProperties.getTextProperties(defaultStyle);
      language = defaultStyleSetting.getLanguage(type);
    }
    return language;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

        parentStyle = getParentStyle((OdfStyle) parentStyle);
      }
    }
    // find in default style definition
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getParagraphDefaultStyle();
      ParagraphProperties defaultStyleSetting = ParagraphProperties.getParagraphProperties(defaultStyle);
      tempAlign = defaultStyleSetting.getHorizontalAlignment();
    }
    // use default
    if (tempAlign == null) {
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

        isDefault = true;
      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      TextProperties defaultStyleSetting = TextProperties.getTextProperties(defaultStyle);
      country = defaultStyleSetting.getCountry(type);
    }
    return country;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

        isDefault = true;
      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      // For text document, there is no default table cell style.
      // So use default font style in default paragraph style.
      if (defaultStyle == null) {
        defaultStyle = getParagraphDefaultStyle();
      }
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

        isDefault = true;
      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      TextProperties defaultStyleSetting = TextProperties.getTextProperties(defaultStyle);
      language = defaultStyleSetting.getLanguage(type);
    }
    return language;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.style.OdfDefaultStyle

      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    // find in default style definition
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      TableCellProperties defaultStyleSetting = TableCellProperties.getTableCellProperties(defaultStyle);
      tempColor = defaultStyleSetting.getBackgroundColor();
    }
    // use default
    if (tempColor == null)
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.