Java Code Examples for com.google.gwt.dom.client.Style#clearProperty()

The following examples show how to use com.google.gwt.dom.client.Style#clearProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseCellMapper.java    From jetpad-projectional-open-source with Apache License 2.0 6 votes vote down vote up
private void applyBackground(String color, String underline) {
  Style style = getTarget().getStyle();
  if (color == null) {
    if (underline == null) {
      style.clearProperty(BACKGROUND);
    } else {
      style.setProperty(BACKGROUND, underline + UNDERLINE_SUFFIX);
    }
  } else {
    if (underline == null) {
      style.setProperty(BACKGROUND, color);
    } else {
      style.setProperty(BACKGROUND, underline + UNDERLINE_SUFFIX + " " + color);
    }
  }
}
 
Example 2
Source File: CubaGroupBoxWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
public void setCollapsable(boolean collapsable) {
    Style expanderStyle = expander.getStyle();
    if (collapsable) {
        expanderStyle.clearProperty("display");
        removeStyleDependentName("nocollapsable");
    } else {
        addStyleDependentName("nocollapsable");
        expanderStyle.setDisplay(Style.Display.NONE);
    }

    Tools.textSelectionEnable(captionNode, !collapsable);

    this.collapsable = collapsable;
}
 
Example 3
Source File: Image.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void resetSize() {
	Style imgStyle = this.imgElement.getStyle();
	imgStyle.clearProperty(Image.PROP_WIDTH);
	imgStyle.clearProperty(Image.PROP_HEIGHT);
	imgStyle.clearProperty(Image.PROP_MAX_WIDTH);
	imgStyle.clearProperty(Image.PROP_MAX_HEIGHT);

	if (this.widthPx > 0) {
		imgStyle.setPropertyPx(this.keepPropertions ? Image.PROP_MAX_WIDTH : Image.PROP_WIDTH, this.widthPx);
	}
	if (this.heightPx > 0) {
		imgStyle.setPropertyPx(this.keepPropertions ? Image.PROP_MAX_HEIGHT : Image.PROP_HEIGHT, this.heightPx);
	}
}