code: public static void toggleStyleName(final UIObject uiObject,
                                         final boolean toggleStyle,
                                         final String styleName) {
          if (toggleStyle) {
              uiObject.addStyleName(styleName);
          } else {
              uiObject.removeStyleName(styleName);
          }
      }
docs: Toggles a style name on a ui object
  
  @param uiObject    Object to toggle style on
  @param toggleStyle whether or not to toggle the style name on the object
  @param styleName   Style name