.paddingRight(paddingRight, Unit.PX); SafeStyles style = SafeStylesUtils.fromTrustedString(builder .toSafeStyles().asString());
/** * 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;"); }
SafeStylesHostedModeUtils.maybeCheckValidStyleName(name); SafeStylesHostedModeUtils.maybeCheckValidStyleValue(value); return fromTrustedString(name + ":" + value + ";");
public SafeHtml getSafeHtml(SafeUri url, int left, int top, int width, int height, boolean isDraggable) { SafeStylesBuilder builder = new SafeStylesBuilder(); builder.width(width, Unit.PX).height(height, Unit.PX).trustedNameAndValue("background", "url(" + url.asString() + ") " + "no-repeat " + (-left + "px ") + (-top + "px")); if (!isDraggable) { return getTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } else { return getDraggableTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } }
SafeStylesUtils.fromTrustedString("padding-right: " + imageWidth + "px;"); if (i == keyboardSelectedRow) {
@Override public void render(Context context, String value, SafeHtmlBuilder sb, String id) { CellTemplate template = GWT.create(CellTemplate.class); sb.append(template.input(value, SafeStylesUtils.fromTrustedString(""), id)); //$NON-NLS-1$ }
/** * 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 void render(Context context, T value, SafeHtmlBuilder sb, String id) { if (value != null) { final SafeHtml renderedImage = getRenderedImage(value); sb.append(template.imageContainerWithStyleClass( id, SafeStylesUtils.fromTrustedString(style), styleClass, renderedImage)); } }
/** * 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;"); }
SafeStylesHostedModeUtils.maybeCheckValidStyleName(name); SafeStylesHostedModeUtils.maybeCheckValidStyleValue(value); return fromTrustedString(name + ":" + value + ";");
SafeStylesHostedModeUtils.maybeCheckValidStyleName(name); SafeStylesHostedModeUtils.maybeCheckValidStyleValue(value); return fromTrustedString(name + ":" + value + ";");
private SafeHtml resultAddOption(OptionItem option) { if (!option.isDisabled()) { option.domId = containerId + "_o_" + option.getArrayIndex(); StringBuilder classes = new StringBuilder(); if (!(option.isSelected() && isMultiple)) { classes.append(css.activeResult()).append(" "); } if (option.isSelected()) { classes.append(css.resultSelected()).append(" "); } if (option.getGroupArrayIndex() != -1) { classes.append(css.groupOption()).append(" "); } if (option.getClasses() != null) { classes.append(option.getClasses()); } SafeStyles safeStyles = SafeStylesUtils.fromTrustedString(option.getStyle()); return ChozenTemplate.templates.option(option.getDomId(), classes.toString().trim(), safeStyles, option.getText()); } return null; }
private SafeHtml resultAddOption(OptionItem option) { if (!option.isDisabled()) { option.domId = containerId + "_o_" + option.getArrayIndex(); StringBuilder classes = buildOptionStyleClass(option); classes.append(" ").append(css.activeResult()); SafeStyles safeStyles = SafeStylesUtils.fromTrustedString(option.getStyle()); if (option.getHtml() != null && !option.getHtml().trim().isEmpty()) { SafeHtml html = fromTrustedString(option.getHtml()); return ChosenTemplate.templates.option(option.getDomId(), classes.toString().trim(), safeStyles, html); } else { return ChosenTemplate.templates.option(option.getDomId(), classes.toString().trim(), safeStyles, option.getText()); } } return null; }
private SafeHtml resultAddOption(OptionItem option) { if (!option.isDisabled()) { option.domId = containerId + "_o_" + option.getArrayIndex(); StringBuilder classes = buildOptionStyleClass(option); classes.append(" ").append(css.activeResult()); SafeStyles safeStyles = SafeStylesUtils.fromTrustedString(option.getStyle()); if (option.getHtml() != null && !option.getHtml().trim().isEmpty()) { SafeHtml html = fromTrustedString(option.getHtml()); return ChosenTemplate.templates.option(option.getDomId(), classes.toString().trim(), safeStyles, html); } else { return ChosenTemplate.templates.option(option.getDomId(), classes.toString().trim(), safeStyles, option.getText()); } } return null; }
public SafeHtml getSafeHtml(SafeUri url, int left, int top, int width, int height, boolean isDraggable) { SafeStylesBuilder builder = new SafeStylesBuilder(); builder.width(width, Unit.PX).height(height, Unit.PX).trustedNameAndValue("background", "url(" + url.asString() + ") " + "no-repeat " + (-left + "px ") + (-top + "px")); if (!isDraggable) { return getTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } else { return getDraggableTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } }
public SafeHtml getSafeHtml(SafeUri url, int left, int top, int width, int height, boolean isDraggable) { SafeStylesBuilder builder = new SafeStylesBuilder(); builder.width(width, Unit.PX).height(height, Unit.PX).trustedNameAndValue("background", "url(" + url.asString() + ") " + "no-repeat " + (-left + "px ") + (-top + "px")); if (!isDraggable) { return getTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } else { return getDraggableTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } }
/** * Render the cell. Using the value, the id, and the context, append some HTML to the * SafeHtmlBuilder that will show in the cell when it is rendered. * * Override this and use the id in your render. * * @see org.ovirt.engine.ui.common.widget.table.cell.Cell#render(com.google.gwt.cell.client.Cell.Context, java.lang.Object, com.google.gwt.safehtml.shared.SafeHtmlBuilder, java.lang.String) */ // TODO-GWT: copied from GWT CheckboxCell, with ID injected. Keep in sync on GWT upgrade. public void render(Context context, Boolean value, SafeHtmlBuilder sb, String id) { // Get the view data. Object key = context.getKey(); Boolean viewData = getViewData(key); if (viewData != null && viewData.equals(value)) { clearViewData(key); viewData = null; } if (value != null && ((viewData != null) ? viewData : value)) { sb.append(templates.inputChecked(id, additionalStyles != null ? additionalStyles : SafeStylesUtils.fromTrustedString(""))); } else { sb.append(templates.inputUnchecked(id, additionalStyles != null ? additionalStyles : SafeStylesUtils.fromTrustedString(""))); } if (getLabel() != null && StringHelper.isNotNullOrEmpty(getLabel().asString())) { sb.append(getLabel()); } }
SafeStylesUtils.fromTrustedString("padding-right: " + imageWidth + "px;"); if (i == keyboardSelectedRow) {
SafeStylesUtils.fromTrustedString("padding-right: " + imageWidth + "px;"); if (i == keyboardSelectedRow) {