WidthCss extends AbstractCssProperty<WidthCss> { public void setPercent(final float percent) { value = percent; cssLengthUnit = CssLengthUnit.PER; cssValue = String.valueOf(percent) + cssLengthUnit; if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } } WidthCss();  WidthCss(final String cssValue);  WidthCss(final WidthCss widthCss);  WidthCss(final float percent);  WidthCss(final float value, final CssLengthUnit cssLengthUnit); WidthCss setValue(final float value,
            final CssLengthUnit cssLengthUnit); void setPercent(final float percent); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); Float getValue(); CssLengthUnit getUnit(); @Override WidthCss setCssValue(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); void setAsAvailable(); void setAsMinContent(); void setAsMaxContent(); void setAsFill(); void setAsContentBox(); void setAsBorderBox(); static boolean isValid(final String cssValue); static final String AUTO; static final String INITIAL; static final String INHERIT; static final String FIT_CONTENT; static final String AVAILABLE; static final String MIN_CONTENT; static final String MAX_CONTENT; static final String FILL; static final String CONTENT_BOX; static final String BORDER_BOX; }
@Test public void testSetPercent() { { WidthCss widthCss = new WidthCss(); widthCss.setPercent(75); assertEquals("75.0%", widthCss.getCssValue()); assertEquals(CssLengthUnit.PER, widthCss.getUnit()); assertTrue(widthCss.getValue() == 75); } }