List of usage examples for com.google.gwt.dom.client Style clearBorderStyle
public void clearBorderStyle()
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);/*from ww w .j ava 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.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.j a v a 2s .c om 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()); } }