Examples of OdfNumberStyle


Examples of org.odftoolkit.odfdom.incubator.doc.number.OdfNumberStyle

    OfficeValueTypeAttribute.Value typeValue = null;
    msFormatString = formatStr;
    splitRepeatedCells();
    typeValue = OfficeValueTypeAttribute.Value.enumValueOf(type);
    if (typeValue == OfficeValueTypeAttribute.Value.FLOAT) {
      OdfNumberStyle numberStyle = new OdfNumberStyle(
          (OdfFileDom) mCellElement.getOwnerDocument(),
          formatStr,
          getUniqueNumberStyleName());
      mCellElement.getAutomaticStyles().appendChild(numberStyle);
      setDataDisplayStyleName(numberStyle.getStyleNameAttribute());
      Double value = getDoubleValue();
      if (value != null) {
        setDisplayText((new DecimalFormat(formatStr)).format(value.doubleValue()));
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.DATE) {
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.number.OdfNumberStyle

      typeValue = OfficeValueTypeAttribute.Value.enumValueOf(type);
    }

    if (typeValue == OfficeValueTypeAttribute.Value.FLOAT) {
      String name = getDataDisplayStyleName();
      OdfNumberStyle style = mCellElement.getAutomaticStyles().getNumberStyle(name);
      if (style == null) {
        style = mDocument.getDocumentStyles().getNumberStyle(name);
      }
      if (style != null) {
        return style.getFormat();
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.DATE) {
      String name = getDataDisplayStyleName();
      OdfNumberDateStyle style = mCellElement.getAutomaticStyles().getDateStyle(name);
      if (style == null) {
        style = mDocument.getDocumentStyles().getDateStyle(name);
      }
      if (style != null) {
        return style.getFormat();
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.CURRENCY) {
      String name = getCurrencyDisplayStyleName();
      OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(name);
      if (dataStyle == null) {
        dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(name);
      }
      if (dataStyle != null) {
        return dataStyle.getFormat();
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.PERCENTAGE) {
      String name = getDataDisplayStyleName();
      OdfNumberPercentageStyle style = mCellElement.getAutomaticStyles().getPercentageStyle(name);
      if (style == null) {
        style = mDocument.getDocumentStyles().getPercentageStyle(name);
      }
      if (style != null) {
        return style.getFormat();
      }
    }
    return null;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.number.OdfNumberStyle

    }
    if (formatStr == null)
      throw new IllegalArgumentException("formatStr cannot be null.");

    if (type == OfficeValueTypeAttribute.Value.FLOAT) {
      OdfNumberStyle numberStyle = new OdfNumberStyle(
          (OdfFileDom) mElement.getOwnerDocument(), formatStr,
          getUniqueNumberStyleName());
      numberStyle.setNumberLanguageAttribute(locale.getLanguage());
      numberStyle.setNumberCountryAttribute(locale.getCountry());
      drawingShape.getOdfElement().getAutomaticStyles().appendChild(
          numberStyle);
      setDataDisplayStyleName(numberStyle.getStyleNameAttribute());
    } else if (type == OfficeValueTypeAttribute.Value.DATE) {
      OdfNumberDateStyle dateStyle = new OdfNumberDateStyle(
          (OdfFileDom) mElement.getOwnerDocument(), formatStr,
          getUniqueDateStyleName(), null);
      dateStyle.setNumberLanguageAttribute(locale.getLanguage());
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.number.OdfNumberStyle

    Document mDocument = ((Document) ((OdfFileDom) mElement
        .getOwnerDocument()).getDocument());

    if (typeValue == OfficeValueTypeAttribute.Value.FLOAT) {
      String name = getDataDisplayStyleName();
      OdfNumberStyle style = drawingShape.getOdfElement()
          .getAutomaticStyles().getNumberStyle(name);
      if (style == null) {
        style = ((OdfSchemaDocument) mDocument).getDocumentStyles()
            .getNumberStyle(name);
      }
      if (style != null) {
        return style.getFormat();
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.DATE) {
      String name = getDataDisplayStyleName();
      OdfNumberDateStyle style = drawingShape.getOdfElement()
          .getAutomaticStyles().getDateStyle(name);
      if (style == null) {
        style = ((OdfSchemaDocument) mDocument).getDocumentStyles()
            .getDateStyle(name);
      }
      if (style != null) {
        return style.getFormat();
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.TIME) {
      String name = getDataDisplayStyleName();
      OdfNumberDateStyle style = drawingShape.getOdfElement()
          .getAutomaticStyles().getDateStyle(name);
      if (style == null) {
        style = ((OdfSchemaDocument) mDocument).getDocumentStyles()
            .getDateStyle(name);
      }
      if (style != null) {
        return style.getFormat();
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.PERCENTAGE) {
      String name = getDataDisplayStyleName();
      OdfNumberPercentageStyle style = drawingShape.getOdfElement()
          .getAutomaticStyles().getPercentageStyle(name);
      if (style == null) {
        style = ((OdfSchemaDocument) mDocument).getDocumentStyles()
            .getPercentageStyle(name);
      }
      if (style != null) {
        return style.getFormat();
      }
    }
    return 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.