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

The following are Jave code examples for showing how to use clearProperty() of the com.google.gwt.dom.client.Style class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: cuba   File: CubaGroupBoxWidget.java   View Source Code Vote up 5 votes
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 2
Project: forplay   File: HtmlImageLayerDom.java   View Source Code Vote up 5 votes
private void applyBackgroundSize() {
  Style style = element().getStyle();

  // Set background-repeat to get the right repeating behavior.
  String repeat = repeatX ? "repeat-x " : "";
  repeat += repeatY ? "repeat-y" : "";
  style.setProperty("backgroundRepeat", repeat);

  // Set background-size to get the right pinning behavior.
  if (sourceRectSet) {
    float wratio = widthSet ? (width / sw) : (image().width() / sw);
    float hratio = heightSet ? (height / sh) : (image().height() / sh);
    if (wratio == 0) {
      wratio = 1;
    }
    if (hratio == 0) {
      hratio = 1;
    }
    float backWidth = image().width() * wratio;
    float backHeight = image().height() * hratio;

    style.setProperty("backgroundSize", backWidth + "px " + backHeight + "px");
    style.setProperty("backgroundPosition", (-sx * wratio) + "px " + (-sy * hratio) + "px");
  } else {
    String size = repeatX ? image().width() + "px " : "100% ";
    size += repeatY ? image().height() + "px" : "100%";
    style.setProperty("backgroundSize", size);
    style.clearProperty("backgroundPosition");
  }
}
 
Example 3
Project: empiria.player   File: ElementScaler.java   View Source Code Vote up 4 votes
public void clearMaxWidth() {
    Style style = element.getParentElement().getStyle();
    style.clearProperty(MAX_WIDTH_PROPERTY);
}
 
Example 4
Project: Wiab.pro   File: DomUtil.java   View Source Code Vote up 4 votes
/**
 * Unfixes element's height.
 */
public static void unfixElementHeight(Element element) {
  Style style = element.getStyle();
  style.clearProperty(STYLE_MIN_HEIGHT_PROPERTY);
  style.clearProperty(STYLE_MAX_HEIGHT_PROPERTY);
}