Outline extends AbstractCssProperty<Outline> implements StateChangeInformer<CssProperty> { public Outline setOutlineStyle(final OutlineStyle outlineStyle) { final StringBuilder cssValueBuilder = new StringBuilder(); if (outlineColor != null) { cssValueBuilder.append(outlineColor.getCssValue()).append(' '); } if (outlineStyle != null) { cssValueBuilder.append(outlineStyle.getCssValue()).append(' '); } if (outlineWidth != null) { cssValueBuilder.append(outlineWidth.getCssValue()); } final String trimmedCssValue = StringBuilderUtil .getTrimmedString(cssValueBuilder).toString(); cssValue = trimmedCssValue.isEmpty() ? INHERIT : trimmedCssValue; this.outlineStyle = outlineStyle; if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } return this; } Outline();  Outline(final String cssValue);  Outline(final Outline outline); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override Outline setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); OutlineColor getOutlineColor(); OutlineStyle getOutlineStyle(); OutlineWidth getOutlineWidth(); Outline setOutlineWidth(final OutlineWidth outlineWidth); Outline setOutlineStyle(final OutlineStyle outlineStyle); Outline setOutlineColor(final OutlineColor outlineColor); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; }
@Test public void testSetOutlineStyle() { Outline border = new Outline(); border.setCssValue("green solid thick"); assertEquals("green solid thick", border.getCssValue()); border.setOutlineStyle(null); assertEquals("green thick", border.getCssValue()); border.setOutlineStyle(OutlineStyle.GROOVE); assertEquals("green groove thick", border.getCssValue()); border.setCssValue("red thick"); assertNull(border.getOutlineStyle()); assertEquals("red thick", border.getCssValue()); }