PercentageStyle implements DataStyle { @Override public String getName() { return this.floatStyle.getName(); } PercentageStyle(final FloatStyle floatStyle); @Override void appendXMLContent(final XMLUtil util, final Appendable appendable); @Override String getName(); @Override boolean isHidden(); @Override void addToElements(final OdsElements odsElements);  }
@Test public final void testNegativeValueRed() throws IOException { final PercentageStyle ps = new PercentageStyleBuilder("test", this.locale).negativeValueRed().build(); TestHelper.assertXMLEquals( "<number:percentage-style style:name=\"test\" number:language=\"en\" " + "number:country=\"US\" " + "style:volatile=\"true\">" + "<number:number number:decimal-places=\"2\" " + "number:min-integer-digits=\"1\"/>" + "<number:text>%</number:text>" + "</number:percentage-style>" + "<number:percentage-style style:name=\"test-neg\" " + "number:language=\"en\" number:country=\"US\" style:volatile=\"true\">" + "<style:text-properties fo:color=\"#ff0000\"/>" + "<number:text>-</number:text>" + "<number:number number:decimal-places=\"2\" " + "number:min-integer-digits=\"1\"/>" + "<number:text>%</number:text>" + "<style:map style:condition=\"value()&gt;=0\" " + "style:apply-style-name=\"test\"/>" + "</number:percentage-style>", ps); Assert.assertEquals("test", ps.getName()); }