Example usage for com.google.gwt.dom.client Style clearBackgroundImage

List of usage examples for com.google.gwt.dom.client Style clearBackgroundImage

Introduction

In this page you can find the example usage for com.google.gwt.dom.client Style clearBackgroundImage.

Prototype

public void clearBackgroundImage() 

Source Link

Usage

From source file:com.smartgwt.mobile.client.widgets.BaseButton.java

License:Open Source License

private void doSetIcon(boolean fireContentChangedEvent) {
    assert icon != null && iconImage != null;
    final Element img = iconImage.getElement();
    final Style imgStyle = img.getStyle();
    if (masked) {
        iconImage.setResource(IconResources.INSTANCE.blank());
        if ("IMG".equals(img.getTagName())) {
            final ImageElement iconImageImgElem = ImageElement.as(img);
            iconImageImgElem.removeAttribute("width");
            iconImageImgElem.removeAttribute("height");
        }//from  ww  w  .j av a2 s  . c  o  m
        imgStyle.clearWidth();
        imgStyle.clearHeight();
        img.setClassName(_CSS.maskedButtonIconClass());
        imgStyle.clearBackgroundColor();
        imgStyle.clearBackgroundImage();
        // Note: Mobile WebKit automatically scales down the mask image to fit the element
        // to which the mask image is applied.
        imgStyle.setProperty("WebkitMaskBoxImage", "url(" + icon.getSafeUri().asString() + ")");
    } else {
        if ("IMG".equals(img.getTagName())) {
            final ImageElement iconImageImgElem = ImageElement.as(img);
            iconImageImgElem.removeAttribute("width");
            iconImageImgElem.removeAttribute("height");
        }
        imgStyle.clearWidth();
        imgStyle.clearHeight();
        imgStyle.clearProperty("MozBackgroundSize");
        imgStyle.clearProperty("OBackgroundSize");
        imgStyle.clearProperty("WebkitBackgroundSize");
        imgStyle.clearProperty("backgroundSize");
        img.removeClassName(_CSS.maskedButtonIconClass());
    }

    setIconAlign(iconAlign);
    if (iconColor != null) {
        setIconColor(iconColor);
    }

    imgStyle.clearVisibility();
    if (fireContentChangedEvent)
        _fireContentChangedEvent();
}