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

The following examples show how to use com.google.gwt.dom.client.Style#clearWidth() . 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: MockImageBase.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
private void unclipImage() {
  Style style = image.getElement().getStyle();
  style.clearLeft();
  style.clearTop();
  style.clearWidth();
  style.clearHeight();
}
 
Example 2
Source File: CubaSuggestPopup.java    From cuba with Apache License 2.0 5 votes vote down vote up
public CubaSuggestPopup() {
    Style style = loadingImage.getElement().getStyle();

    style.clearWidth();
    style.clearHeight();
    style.setDisplay(Style.Display.BLOCK);
}
 
Example 3
Source File: ImageThumbnailWidget.java    From swellrt with Apache License 2.0 5 votes vote down vote up
private void setImageSize() {
  int width = isFullSize?attachmentWidth:thumbnailWidth;
  int height = isFullSize?attachmentHeight:thumbnailHeight;
  image.setPixelSize(width, height);
  //TODO(user,danilatos): Whinge about how declarative UI doesn't let us avoid this hack:
  Style pstyle = image.getElement().getParentElement().getParentElement().getStyle();
  if (width == 0) {
    image.setWidth("");
    pstyle.clearWidth();
  } else {
    pstyle.setWidth(width, Unit.PX);
  }
  if (height == 0) {
    image.setHeight("");
    pstyle.clearHeight();
  } else {
    pstyle.setHeight(height, Unit.PX);
  }

  String url = isFullSize?attachmentUrl:thumbnailUrl;
  if (url != null) {
    if (doubleBufferLoader == null) {
      doubleBufferLoader = new DoubleBufferImage(spin, errorLabel, image);
    }
    doubleBufferLoader.loadImage(url);
    DOM.setStyleAttribute(image.getElement(), "visibility", "");
  }

  // NOTE(user): IE requires that the imageCaptionContainer element has a width
  //   in order to correctly center the caption.
  if (DO_FRAME_WIDTH_UPDATE) {
    captionPanel.getElement().getStyle().setWidth(width, Unit.PX);
  }
}
 
Example 4
Source File: Affix.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void clearElementStyle() {
	Element e = this.getElement();
	Style style = e.getStyle();

	style.clearPosition();
	style.clearTop();
	style.clearBottom();
	style.clearWidth();
	style.clearHeight();
	style.clearZIndex();
	e.getParentElement().getStyle().clearPaddingTop();
}
 
Example 5
Source File: ImageThumbnailWidget.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
private void setImageSize() {
  int width = isFullSize?attachmentWidth:thumbnailWidth;
  int height = isFullSize?attachmentHeight:thumbnailHeight;
  image.setPixelSize(width, height);
  //TODO(user,danilatos): Whinge about how declarative UI doesn't let us avoid this hack:
  Style pstyle = image.getElement().getParentElement().getParentElement().getStyle();
  if (width == 0) {
    image.setWidth("");
    pstyle.clearWidth();
  } else {
    pstyle.setWidth(width, Unit.PX);
  }
  if (height == 0) {
    image.setHeight("");
    pstyle.clearHeight();
  } else {
    pstyle.setHeight(height, Unit.PX);
  }

  String url = isFullSize?attachmentUrl:thumbnailUrl;
  if (url != null) {
    if (doubleBufferLoader == null) {
      doubleBufferLoader = new DoubleBufferImage(spin, errorLabel, image);
    }
    doubleBufferLoader.loadImage(url);
    DOM.setStyleAttribute(image.getElement(), "visibility", "");
  }

  // NOTE(user): IE requires that the imageCaptionContainer element has a width
  //   in order to correctly center the caption.
  if (DO_FRAME_WIDTH_UPDATE) {
    captionPanel.getElement().getStyle().setWidth(width, Unit.PX);
  }
}