MsFlex extends AbstractCssProperty<MsFlex> implements StateChangeInformer<CssProperty> { @Override public void stateChanged(final CssProperty stateChangedObject) { if (stateChangedObject instanceof FlexGrow) { final FlexGrow flexGrow = (FlexGrow) stateChangedObject; final String cssValue = flexGrow.getCssValue(); if (FlexGrow.INITIAL.equals(cssValue) || FlexGrow.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as flexGrow cssValue"); } this.cssValue = new StringBuilder(flexGrow.getCssValue()) .append(' ').append(flexShrink.getCssValue()).append(' ') .append(flexBasis.getCssValue()).toString(); } else if (stateChangedObject instanceof FlexShrink) { final FlexShrink flexShrink = (FlexShrink) stateChangedObject; final String cssValue = flexShrink.getCssValue(); if (FlexShrink.INITIAL.equals(cssValue) || FlexShrink.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as flexShrink cssValue"); } this.cssValue = new StringBuilder(flexGrow.getCssValue()) .append(' ').append(flexShrink.getCssValue()).append(' ') .append(flexBasis.getCssValue()).toString(); } else if (stateChangedObject instanceof FlexBasis) { final FlexBasis flexBasis = (FlexBasis) stateChangedObject; final String cssValue = flexBasis.getCssValue(); if (FlexBasis.INITIAL.equals(cssValue) || FlexBasis.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as flexBasis cssValue"); } this.cssValue = new StringBuilder(flexGrow.getCssValue()) .append(' ').append(flexShrink.getCssValue()).append(' ') .append(flexBasis.getCssValue()).toString(); } } MsFlex();  MsFlex(final String cssValue);  MsFlex(final MsFlex msFlex); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override MsFlex setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); FlexBasis getFlexBasis(); FlexShrink getFlexShrink(); FlexGrow getFlexGrow(); MsFlex setFlexGrow(final FlexGrow flexGrow); MsFlex setFlexShrink(final FlexShrink flexShrink); MsFlex setFlexBasis(final FlexBasis flexBasis); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test public void testStateChanged() { }