private static void setOffsetHeight ( final Widget widget , int height ) { widget . setHeight ( height + "px" ) ; final int offset = widget . getOffsetHeight ( ) ; if ( offset > 0 ) { height -= offset - height ; if ( height > 0 ) { widget . setHeight ( height + "px" ) ; } } }
Properly sets the total height of a widget . This takes into account decorations such as border margin and padding .