Package org.odftoolkit.odfdom.incubator.doc.number

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


      if (dateStr != null) {
        Calendar date = getDateValue();
        setDisplayText((new SimpleDateFormat(formatStr)).format(date.getTime()));
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.TIME) {
      OdfNumberTimeStyle timeStyle = new OdfNumberTimeStyle(
          (OdfFileDom) mCellElement.getOwnerDocument(), formatStr,
          getUniqueDateStyleName());
      mCellElement.getAutomaticStyles().appendChild(timeStyle);
      setDataDisplayStyleName(timeStyle.getStyleNameAttribute());
      String timeStr = mCellElement.getOfficeTimeValueAttribute();
      if (timeStr != null) {
        Calendar time = getTimeValue();
        setDisplayText((new SimpleDateFormat(formatStr)).format(time.getTime()));
      }
View Full Code Here


      if (dateStr != null) {
        Calendar date = getDateValue();
        setDisplayTextContent((new SimpleDateFormat(formatStr)).format(date.getTime()), null);
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.TIME) {
      OdfNumberTimeStyle timeStyle = new OdfNumberTimeStyle((OdfFileDom) mCellElement.getOwnerDocument(),
          formatStr, getUniqueDateStyleName());
      mCellElement.getAutomaticStyles().appendChild(timeStyle);
      setDataDisplayStyleName(timeStyle.getStyleNameAttribute());
      String timeStr = mCellElement.getOfficeTimeValueAttribute();
      if (timeStr != null) {
        Calendar time = getTimeValue();
        setDisplayTextContent((new SimpleDateFormat(formatStr)).format(time.getTime()), null);
      }
View Full Code Here

      if (dateStr != null) {
        Calendar date = getDateValue();
        setDisplayTextContent((new SimpleDateFormat(formatStr)).format(date.getTime()), null);
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.TIME) {
      OdfNumberTimeStyle timeStyle = new OdfNumberTimeStyle((OdfFileDom) mCellElement.getOwnerDocument(),
          formatStr, getUniqueDateStyleName());
      mCellElement.getAutomaticStyles().appendChild(timeStyle);
      setDataDisplayStyleName(timeStyle.getStyleNameAttribute());
      String timeStr = mCellElement.getOfficeTimeValueAttribute();
      if (timeStr != null) {
        Calendar time = getTimeValue();
        setDisplayTextContent((new SimpleDateFormat(formatStr)).format(time.getTime()), null);
      }
View Full Code Here

      if (dateStr != null) {
        Calendar date = getDateValue();
        setDisplayText((new SimpleDateFormat(formatStr)).format(date.getTime()));
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.TIME) {
      OdfNumberTimeStyle timeStyle = new OdfNumberTimeStyle(
          (OdfFileDom) mCellElement.getOwnerDocument(), formatStr,
          getUniqueDateStyleName());
      mCellElement.getAutomaticStyles().appendChild(timeStyle);
      setDataDisplayStyleName(timeStyle.getStyleNameAttribute());
      String timeStr = mCellElement.getOfficeTimeValueAttribute();
      if (timeStr != null) {
        Calendar time = getTimeValue();
        setDisplayText((new SimpleDateFormat(formatStr)).format(time.getTime()));
      }
View Full Code Here

        mCurrencyStyles = new HashMap<String, OdfNumberCurrencyStyle>();
      }

      mCurrencyStyles.put(currencyStyle.getStyleNameAttribute(), currencyStyle);
    } else if (node instanceof OdfNumberTimeStyle) {
      OdfNumberTimeStyle timeStyle = (OdfNumberTimeStyle) node;

      if (mTimeStyles == null) {
        mTimeStyles = new HashMap<String, OdfNumberTimeStyle>();
      }

      mTimeStyles.put(timeStyle.getStyleNameAttribute(), timeStyle);
    } else if (node instanceof NumberBooleanStyleElement) {
      NumberBooleanStyleElement booleanStyle = (NumberBooleanStyleElement) node;

      if (mBooleanStyles == null) {
        mBooleanStyles = new HashMap<String, NumberBooleanStyleElement>();
View Full Code Here

        OdfNumberCurrencyStyle currencyStyle = (OdfNumberCurrencyStyle) node;
        mCurrencyStyles.remove(currencyStyle.getStyleNameAttribute());
      }
    } else if (node instanceof OdfNumberTimeStyle) {
      if (mTimeStyles != null) {
        OdfNumberTimeStyle timeStyle = (OdfNumberTimeStyle) node;
        mTimeStyles.remove(timeStyle.getStyleNameAttribute());
      }
    } else if (node instanceof NumberBooleanStyleElement) {
      if (mBooleanStyles != null) {
        NumberBooleanStyleElement booleanStyle = (NumberBooleanStyleElement) node;
        mBooleanStyles.remove(booleanStyle.getStyleNameAttribute());
View Full Code Here

      {"ELhours", "T:",
        "ELminutes", "T:", "ELseconds"} // "HH:mm:ss"
    };

        LOG.info("buildFromFormat");
        OdfNumberTimeStyle instance = null;

        for (i = 0; i < formatTest.length; i++)
    {
      LOG.info("Time format: " + formatTest[i]);
      instance = new OdfNumberTimeStyle(dom,
        formatTest[i], "fstyle");
      Assert.assertNotNull(instance.getFirstChild());

      checkNodes(instance.getFirstChild(), expected[i], 0);
    }
  }
View Full Code Here

      if (dateStr != null) {
        Calendar date = getDateValue();
        setDisplayTextContent((new SimpleDateFormat(formatStr)).format(date.getTime()), null);
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.TIME) {
      OdfNumberTimeStyle timeStyle = new OdfNumberTimeStyle((OdfFileDom) mCellElement.getOwnerDocument(),
          formatStr, getUniqueDateStyleName());
      mCellElement.getAutomaticStyles().appendChild(timeStyle);
      setDataDisplayStyleName(timeStyle.getStyleNameAttribute());
      String timeStr = mCellElement.getOfficeTimeValueAttribute();
      if (timeStr != null) {
        Calendar time = getTimeValue();
        setDisplayTextContent((new SimpleDateFormat(formatStr)).format(time.getTime()), null);
      }
View Full Code Here

  // package constructor, only called by Fields.
  TimeField(OdfElement odfElement) {
    TextSpanElement spanElement = ((OdfFileDom) odfElement.getOwnerDocument()).newOdfElement(TextSpanElement.class);
    odfElement.appendChild(spanElement);
    timeElement = spanElement.newTextTimeElement();
    OdfNumberTimeStyle timeStyle = newTimeStyle();
    String timeStyleName = timeStyle.getStyleNameAttribute();
    timeStyle.buildFromFormat(DEFAULT_TIME_FORMAT);
    timeStyle.setStyleNameAttribute(timeStyleName);
    timeElement.setStyleDataStyleNameAttribute(timeStyle.getStyleNameAttribute());
    Calendar calender = Calendar.getInstance();
    SimpleDateFormat simpleFormat = new SimpleDateFormat(DEFAULT_TIME_VALUE_FORMAT);
    Date time = calender.getTime();
    String svalue = simpleFormat.format(time);
    timeElement.setTextTimeValueAttribute(svalue);
View Full Code Here

      if (dom instanceof OdfContentDom) {
        styles = ((OdfContentDom) dom).getAutomaticStyles();
      } else if (dom instanceof OdfStylesDom) {
        styles = ((OdfStylesDom) dom).getAutomaticStyles();
      }
      OdfNumberTimeStyle dataStyle = styles.getTimeStyle(timeElement.getStyleDataStyleNameAttribute());
      dataStyle.buildFromFormat(formatString);
    } catch (ParseException e) {
      Logger.getLogger(TimeField.class.getName()).log(Level.SEVERE, e.getMessage(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.incubator.doc.number.OdfNumberTimeStyle

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.