/** * 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;"); }
/** * 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;"); }
/** * 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;"); }