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

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

Introduction

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

Prototype

public void clearBorderColor() 

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);/* w w  w  .j  a  va2s . c o  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.goodow.wave.client.wavepanel.blip.SetColor.java

License:Apache License

@Override
public void onBrowserEvent(final Event event) {
    if (DOM.eventGetType(event) == Event.ONCLICK) {
        if (changeElm == null) {
            Window.alert("changeElm is null!");
            return;
        }//from ww  w . jav a  2 s.  com

        NodeList<Element> aTags = changeElm.getElementsByTagName("span");
        Element aTag = aTags.getItem(1);
        Element elm = Element.as(event.getEventTarget());
        Style elmStyle = elm.getStyle();
        Style aTagStyle = aTag.getStyle();

        if (elm.getTitle().equals("White") || elm.getTitle().equals("20% Black")) {
            aTagStyle.setBackgroundColor(elmStyle.getBackgroundColor());
            aTagStyle.setColor("black");
            aTagStyle.setBorderStyle(BorderStyle.SOLID);
            aTagStyle.setBorderWidth(1, Unit.PX);
            aTagStyle.setBorderColor("black");
            aTagStyle.setTextDecoration(TextDecoration.NONE);
        } else {
            if (!aTagStyle.getBorderWidth().equals("")) {
                aTagStyle.clearBorderColor();
                aTagStyle.clearBorderStyle();
                aTagStyle.clearBorderWidth();
            }
            aTagStyle.setTextDecoration(TextDecoration.NONE);
            aTagStyle.setBackgroundColor(elmStyle.getBackgroundColor());
            aTagStyle.setColor("white");
        }
        // Window.alert("title:" + elm.getTitle() + ";color:" + elm.getStyle().getBackgroundColor());
    }
}