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

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

Introduction

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

Prototype

public void clearBackgroundColor() 

Source Link

Usage

From source file:com.goodow.wave.client.wavepanel.blip.SetColor.java

License:Apache License

public SetColor() {
    Widget widget = binder.createAndBindUi(this);
    this.getElement().getStyle().setWidth(129, Unit.PX);
    this.add(widget);
    this.setAutoHideEnabled(true);
    NodeList<Node> childNodes = colors.getChildNodes();
    putColor(childNodes);/*  www.ja  v  a  2 s.co m*/

    DOM.sinkEvents((com.google.gwt.user.client.Element) noColor, Event.ONCLICK);
    DOM.setEventListener((com.google.gwt.user.client.Element) noColor, new EventListener() {

        @Override
        public void onBrowserEvent(final Event event) {
            if (DOM.eventGetType(event) == Event.ONCLICK) {
                NodeList<Element> aTags = changeElm.getElementsByTagName("span");
                Element aTag = aTags.getItem(1);
                Style aTagStyle = aTag.getStyle();
                aTagStyle.clearColor();
                aTagStyle.clearBackgroundColor();
                aTagStyle.clearBorderColor();
                aTagStyle.clearBorderStyle();
                aTagStyle.clearBorderWidth();
                aTagStyle.clearTextDecoration();
            }
        }
    });
}

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");
        }/*  w w  w .  j a v a  2 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();
}

From source file:com.threerings.admin.web.client.ConfigFieldEditor.java

License:Open Source License

protected void updateModificationState() {
    Style style = _value.getElement().getStyle();
    if (getModifiedField() != null) {
        style.setBackgroundColor("red");
        _reset.setVisible(true);/*  w  w w.  j a  v a  2  s.  co m*/

    } else {
        style.clearBackgroundColor();
        _reset.setVisible(false);
    }
    _onChange.execute();
}