public static < T extends Widget > T setStyleNames ( T widget , String ... styles ) { int idx = 0 ; for ( String style : styles ) { if ( style == null ) { continue ; } if ( idx ++ == 0 ) { widget . setStyleName ( style ) ; } else { widget . addStyleName ( style ) ; } } return widget ; }
Configures the supplied styles on the supplied widget . Existing styles will not be preserved unless you call this with no - non - null styles . Returns the widget for easy chaining .