public Border setBorderStyle ( final BorderStyle borderStyle ) { if ( borderStyle == BorderStyle . INITIAL || borderStyle == BorderStyle . INHERIT ) { throw new InvalidValueException ( "the given borderStyle cannot be " + borderStyle . getCssValue ( ) ) ; } final StringBuilder cssValueBuilder = new StringBuilder ( ) ; if ( borderWidthValue != null ) { cssValueBuilder . append ( borderWidthValue ) . append ( ' ' ) ; } if ( borderStyle != null ) { cssValueBuilder . append ( borderStyle . getCssValue ( ) ) . append ( ' ' ) ; } if ( borderColorCssValues != null ) { cssValueBuilder . append ( borderColorCssValues . getValue ( ) ) . append ( ' ' ) ; } final String trimmedCssValue = StringBuilderUtil . getTrimmedString ( cssValueBuilder ) . toString ( ) ; cssValue = trimmedCssValue . isEmpty ( ) ? INHERIT : trimmedCssValue ; this . borderStyle = borderStyle ; if ( getStateChangeInformer ( ) != null ) { getStateChangeInformer ( ) . stateChanged ( this ) ; } return this ; }
to set the border style .