code: public void setIconType(IconType type) {
          IconType prevType = iconType;
          iconType = type;
          if (iconType != prevType && iconElement != null) {
              iconElement.removeFromParent();
              iconElement = null;
              DomEvent.fireNativeEvent(Document.get().createChangeEvent(), this);
          }
      }
docs: Sets the icon type. If the icon type changes programatically then the
  icon is removed from the dom and recreated.
  
  @param type
  the new icon type