code: 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;
      }
docs: Returns a text widget's value, making sure it is non-empty.
  @throws InputException if the widget has no text