Examples of OdfNumberPercentageStyle


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

      if (timeStr != null) {
        Calendar time = getTimeValue();
        setDisplayTextContent((new SimpleDateFormat(formatStr)).format(time.getTime()), null);
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.PERCENTAGE) {
      OdfNumberPercentageStyle dateStyle = new OdfNumberPercentageStyle((OdfFileDom) mCellElement
          .getOwnerDocument(), formatStr, getUniquePercentageStyleName());
      mCellElement.getAutomaticStyles().appendChild(dateStyle);
      setDataDisplayStyleName(dateStyle.getStyleNameAttribute());
      Double value = getPercentageValue();
      if (value != null) {
        setDisplayTextContent((new DecimalFormat(formatStr)).format(value.doubleValue()), null);
      }
    } else {
View Full Code Here

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

      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.OdfNumberPercentageStyle

          (OdfFileDom) mElement.getOwnerDocument(), formatStr,
          getUniqueDateStyleName());
      mElement.getAutomaticStyles().appendChild(timeStyle);
      setDataDisplayStyleName(timeStyle.getStyleNameAttribute());
    } else if (typeValue == OfficeValueTypeAttribute.Value.PERCENTAGE) {
      OdfNumberPercentageStyle dateStyle = new OdfNumberPercentageStyle(
          (OdfFileDom) mElement.getOwnerDocument(), formatStr,
          getUniquePercentageStyleName());
      mElement.getAutomaticStyles().appendChild(dateStyle);
      setDataDisplayStyleName(dateStyle.getStyleNameAttribute());
    } else {
      throw new IllegalArgumentException("This function doesn't support "
          + type + "formatting.");
    }
  }
View Full Code Here

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

        "#0%:after",
        "before:#0%:after"
    };

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

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

      Assert.assertEquals(expectedFormat[i], instance.getFormat());
    }
  }
View Full Code Here

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

    Node node;
    StyleMapElement mapNode;

    LOG.info("setMapPositive");
    String mapName = "positiveMap";
    OdfNumberPercentageStyle instance = new OdfNumberPercentageStyle(dom,
        "#0", "fstyle");
    instance.setMapPositive(mapName);
    node = instance.getLastChild();
    Assert.assertNotNull(node);
    Assert.assertTrue(node instanceof StyleMapElement);
    mapNode = (StyleMapElement) node;
    Assert.assertEquals("value()>0", mapNode.getStyleConditionAttribute());
    Assert.assertEquals(mapName, mapNode.getStyleApplyStyleNameAttribute());
View Full Code Here

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

    Node node;
    StyleMapElement mapNode;

    LOG.info("setMapNegative");
    String mapName = "negativeMap";
    OdfNumberPercentageStyle instance = new OdfNumberPercentageStyle(dom,
        "#0", "fstyle");
    instance.setMapNegative(mapName);
    node = instance.getLastChild();
    Assert.assertNotNull(node);
    Assert.assertTrue(node instanceof StyleMapElement);
    mapNode = (StyleMapElement) node;
    Assert.assertEquals("value()<0", mapNode.getStyleConditionAttribute());
    Assert.assertEquals(mapName, mapNode.getStyleApplyStyleNameAttribute());
View Full Code Here

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

      if (timeStr != null) {
        Calendar time = getTimeValue();
        setDisplayText((new SimpleDateFormat(formatStr)).format(time.getTime()));
      }
    } else if (typeValue == OfficeValueTypeAttribute.Value.PERCENTAGE) {
      OdfNumberPercentageStyle dateStyle = new OdfNumberPercentageStyle(
          (OdfFileDom) mCellElement.getOwnerDocument(),
          formatStr,
          getUniquePercentageStyleName());
      mCellElement.getAutomaticStyles().appendChild(dateStyle);
      setDataDisplayStyleName(dateStyle.getStyleNameAttribute());
      Double value = getPercentageValue();
      if (value != null) {
        setDisplayText((new DecimalFormat(formatStr)).format(value.doubleValue()));
      }
    } else {
View Full Code Here

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

      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.OdfNumberPercentageStyle

      timeStyle.setNumberCountryAttribute(locale.getCountry());
      drawingShape.getOdfElement().getAutomaticStyles().appendChild(
          timeStyle);
      setDataDisplayStyleName(timeStyle.getStyleNameAttribute());
    } else if (type == OfficeValueTypeAttribute.Value.PERCENTAGE) {
      OdfNumberPercentageStyle dateStyle = new OdfNumberPercentageStyle(
          (OdfFileDom) mElement.getOwnerDocument(), formatStr,
          getUniquePercentageStyleName());
      dateStyle.setNumberLanguageAttribute(locale.getLanguage());
      dateStyle.setNumberCountryAttribute(locale.getCountry());
      drawingShape.getOdfElement().getAutomaticStyles().appendChild(
          dateStyle);
      setDataDisplayStyleName(dateStyle.getStyleNameAttribute());
    } else {
      throw new IllegalArgumentException("This function doesn't support "
          + type + " fomat.");
    }
  }
View Full Code Here

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

      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.