/** * Set the width of the image */ @Override public void setWidth(String width) { img.getStyle().setProperty("width", width); }
/** * Set the height of the image */ @Override public void setHeight(String height) { img.getStyle().setProperty("height", height); }
/** * Set the height of the image */ @Override public void setHeight(String height) { img.getStyle().setProperty("height", height); }
/** * Set the height of the image */ @Override public void setHeight(String height) { img.getStyle().setProperty("height", height); }
/** * Set the width of the image */ @Override public void setWidth(String width) { img.getStyle().setProperty("width", width); }
/** * Set the width of the image */ @Override public void setWidth(String width) { img.getStyle().setProperty("width", width); }
private static int getDim(Image image, String dim) { ImageElement elem = image.getElement().cast(); String width = elem.getStyle().getProperty(dim); if (width == null) { return 0; } Matcher m = PATTERN.matcher(width); if (m.matches()) { return Integer.parseInt(m.group(1)); } return 0; }
private static int getDim(Image image, String dim) { ImageElement elem = image.getElement().cast(); String width = elem.getStyle().getProperty(dim); if (width == null) { return 0; } Matcher m = PATTERN.matcher(width); if (m.matches()) { return Integer.parseInt(m.group(1)); } return 0; }
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); } }
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); } }
private void refreshPositioning() { String src = getSrc(); String text = getText(); Style imgSt = img.getStyle(); if (src == null || src.isEmpty()) { imgSt.setVerticalAlign(VerticalAlign.TOP); imgSt.clearMarginRight(); imgSt.setDisplay(Display.NONE); if (txt != null) txt.getStyle().setVerticalAlign(VerticalAlign.TOP); } else { imgSt.setVerticalAlign(VerticalAlign.MIDDLE); imgSt.clearDisplay(); if (txt != null) txt.getStyle().setVerticalAlign(VerticalAlign.MIDDLE); if (text == null || text.isEmpty()) imgSt.clearMarginRight(); else imgSt.setMarginRight(0.3d, Unit.EM); } }
private void refreshPositioning() { String src = getSrc(); String text = getText(); Style imgSt = img.getStyle(); if (src == null || src.isEmpty()) { imgSt.setVerticalAlign(VerticalAlign.TOP); imgSt.clearMarginRight(); imgSt.setDisplay(Display.NONE); if (txt != null) txt.getStyle().setVerticalAlign(VerticalAlign.TOP); } else { imgSt.setVerticalAlign(VerticalAlign.MIDDLE); imgSt.clearDisplay(); if (txt != null) txt.getStyle().setVerticalAlign(VerticalAlign.MIDDLE); if (text == null || text.isEmpty()) imgSt.clearMarginRight(); else imgSt.setMarginRight(0.3d, Unit.EM); } }
private void refreshPositioning() { String src = getSrc(); String text = getText(); Style imgSt = img.getStyle(); if (src == null || src.isEmpty()) { imgSt.setVerticalAlign(VerticalAlign.TOP); imgSt.clearMarginRight(); imgSt.setDisplay(Display.NONE); if (txt != null) txt.getStyle().setVerticalAlign(VerticalAlign.TOP); } else { imgSt.setVerticalAlign(VerticalAlign.MIDDLE); imgSt.clearDisplay(); if (txt != null) txt.getStyle().setVerticalAlign(VerticalAlign.MIDDLE); if (text == null || text.isEmpty()) imgSt.clearMarginRight(); else imgSt.setMarginRight(0.3d, Unit.EM); } }
@Override Element createThumbnail() { final DivElement thumbnail = DivElement.as(DOM.createDiv()); thumbnail.addClassName(THUMBNAIL_STYLE_NAME); thumbnail.getStyle().setDisplay(Style.Display.INLINE_BLOCK); final SpanElement caption = SpanElement.as(DOM.createSpan()); caption.getStyle().setDisplay(Style.Display.NONE); final ImageElement image = ImageElement.as(DOM.createImg()); image.addClassName(THUMBNAIL_IMAGE_STYLE_NAME); image.getStyle().setDisplay(Style.Display.NONE); thumbnail.appendChild(image); thumbnail.appendChild(caption); return thumbnail; }
@Override Element createThumbnail() { final DivElement thumbnail = DivElement.as(DOM.createDiv()); thumbnail.addClassName(THUMBNAIL_STYLE_NAME); final SpanElement iconFontEl = SpanElement.as(DOM.createSpan()); iconFontEl.addClassName(ICON_STYLE_NAME); Style style = iconFontEl.getStyle(); style.setDisplay(Style.Display.NONE); style.setFontSize(24, Style.Unit.PX); style.setLineHeight(1, Style.Unit.PX); final ImageElement image = ImageElement.as(DOM.createImg()); image.addClassName(THUMBNAIL_IMAGE_STYLE_NAME); image.getStyle().setDisplay(Style.Display.NONE); thumbnail.appendChild(image); thumbnail.appendChild(iconFontEl); return thumbnail; }