List of usage examples for com.google.gwt.dom.client Style setTextDecoration
public void setTextDecoration(TextDecoration value)
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 w ww. jav a 2 s .c o m 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()); } }
From source file:net.sf.mmm.client.ui.gwt.widgets.richtext.FeatureBehaviorStrikethrough.java
License:Apache License
/** * {@inheritDoc}// ww w . jav a2 s. c o m */ @Override protected void updateFontSettings(boolean checked, Style style) { TextDecoration decoration; if (checked) { decoration = TextDecoration.LINE_THROUGH; } else { decoration = TextDecoration.NONE; } style.setTextDecoration(decoration); }
From source file:net.sf.mmm.client.ui.gwt.widgets.richtext.FeatureBehaviorUnderline.java
License:Apache License
/** * {@inheritDoc}//w w w. ja v a 2s.c o m */ @Override protected void updateFontSettings(boolean checked, Style style) { TextDecoration decoration; if (checked) { decoration = TextDecoration.UNDERLINE; } else { decoration = TextDecoration.NONE; } style.setTextDecoration(decoration); }