public static < T extends FocusWidget & HasText > String requireNonEmpty ( T widget , String error ) { String text = widget . getText ( ) . trim ( ) ; if ( text . length ( ) == 0 ) { Popups . errorBelow ( error , widget ) ; widget . setFocus ( true ) ; throw new InputException ( ) ; } return text ; }
Returns a text widget s value making sure it is non - empty .