.paddingRight(paddingRight, Unit.PX); SafeStyles style = SafeStylesUtils.fromTrustedString(builder .toSafeStyles().asString());
/** * Append the left css property. */ public SafeStylesBuilder left(double value, Unit unit) { return append(SafeStylesUtils.forLeft(value, unit)); }
/** * Append the margin-left css property. */ public SafeStylesBuilder marginLeft(double value, Unit unit) { return append(SafeStylesUtils.forMarginLeft(value, unit)); }
@Override public StylesBuilder trustedColor(String value) { return delegate.styleProperty(SafeStylesUtils.forTrustedColor(value)); }
@Override public StylesBuilder trustedBackgroundColor(String value) { return delegate.styleProperty(SafeStylesUtils.forTrustedBackgroundColor(value)); }
/** * Append the right css property. */ public SafeStylesBuilder right(double value, Unit unit) { return append(SafeStylesUtils.forRight(value, unit)); }
@Override public StylesBuilder backgroundImage(SafeUri uri) { return delegate.styleProperty(SafeStylesUtils.forBackgroundImage(uri)); }
/** * Append the border-style CSS property. */ public SafeStylesBuilder borderStyle(BorderStyle value) { return append(SafeStylesUtils.forBorderStyle(value)); }
/** * Append the bottom css property. */ public SafeStylesBuilder bottom(double value, Unit unit) { return append(SafeStylesUtils.forBottom(value, unit)); }
/** * Append the border-width css property. */ public SafeStylesBuilder borderWidth(double value, Unit unit) { return append(SafeStylesUtils.forBorderWidth(value, unit)); }
/** * <p> * Append the trusted font color, i.e., without escaping the value. No checks * are performed. The calling code should be carefully reviewed to ensure the * argument will satisfy the {@link SafeStyles} contract when they are * composed into the form: "<name>:<value>;". * * <p> * {@link SafeStyles} may never contain literal angle brackets. Otherwise, it * could be unsafe to place a {@link SafeStyles} into a <style> tag * (where it can't be HTML escaped). For example, if the {@link SafeStyles} * containing " * <code>font: 'foo <style><script>evil</script></code>'" is * used in a style sheet in a <style> tag, this could then break out of * the style context into HTML. * * @param value the property value * @return a {@link SafeStyles} instance */ public SafeStylesBuilder trustedColor(String value) { return append(SafeStylesUtils.forTrustedColor(value)); }
/** * <p> * Append the trusted background color, i.e., without escaping the value. No * checks are performed. The calling code should be carefully reviewed to * ensure the argument will satisfy the {@link SafeStyles} contract when they * are composed into the form: "<name>:<value>;". * * <p> * {@link SafeStyles} may never contain literal angle brackets. Otherwise, it * could be unsafe to place a {@link SafeStyles} into a <style> tag * (where it can't be HTML escaped). For example, if the {@link SafeStyles} * containing " * <code>font: 'foo <style><script>evil</script></code>'" is * used in a style sheet in a <style> tag, this could then break out of * the style context into HTML. * * @param value the property value * @return a {@link SafeStyles} instance */ public SafeStylesBuilder trustedBackgroundColor(String value) { return append(SafeStylesUtils.forTrustedBackgroundColor(value)); }
@Override public StylesBuilder right(double value, Unit unit) { return delegate.styleProperty(SafeStylesUtils.forRight(value, unit)); }
/** * Append the background-image CSS property. * * @param uri the URI of the background image * @see #trustedBackgroundImage(String) */ public SafeStylesBuilder backgroundImage(SafeUri uri) { return append(SafeStylesUtils.forBackgroundImage(uri)); }
@Override public StylesBuilder borderStyle(BorderStyle value) { return delegate.styleProperty(SafeStylesUtils.forBorderStyle(value)); }
@Override public StylesBuilder bottom(double value, Unit unit) { return delegate.styleProperty(SafeStylesUtils.forBottom(value, unit)); }
@Override public StylesBuilder borderWidth(double value, Unit unit) { return delegate.styleProperty(SafeStylesUtils.forBorderWidth(value, unit)); }
/** * Construct a new {@link IconCellDecorator}. * * @param icon the icon to use * @param cell the cell to decorate * @param valign the vertical alignment attribute of the contents * @param spacing the pixel space between the icon and the cell */ public IconCellDecorator(ImageResource icon, Cell<C> cell, VerticalAlignmentConstant valign, int spacing) { if (template == null) { template = GWT.create(Template.class); } this.cell = cell; this.iconHtml = getImageHtml(icon, valign, false); this.imageWidth = icon.getWidth() + spacing; this.placeHolderHtml = getImageHtml(icon, valign, true); this.outerDivPadding = SafeStylesUtils.fromTrustedString("padding-" + direction + ": " + imageWidth + "px;"); }
@Override public StylesBuilder trustedColor(String value) { return delegate.styleProperty(SafeStylesUtils.forTrustedColor(value)); }