/** * Construct a new {@link ActionCell} with a text String that does not contain * HTML markup. * * @param text the text to display on the button * @param delegate the delegate that will handle events */ public ActionCell(String text, Delegate<C> delegate) { this(SafeHtmlUtils.fromString(text), delegate); }
public SafeHtml render(String object) { return (object == null) ? SafeHtmlUtils.EMPTY_SAFE_HTML : SafeHtmlUtils.fromString(object); }
protected SafeHtml toSafeHtml(Object obj) { return obj == null ? EMPTY_STRING : SafeHtmlUtils.fromString(String.valueOf(obj)); } }
public void render(String object, SafeHtmlBuilder appendable) { appendable.append(SafeHtmlUtils.fromString(object)); } }
/** * @see BidiFormatter#unicodeWrap(String, boolean, boolean) * * @param str The input string * @param dirReset Whether to append a trailing unicode bidi mark matching the * context direction, when needed, to prevent the possible garbling * of whatever may follow {@code str} * @return Input string after applying the above processing. */ public SafeHtml unicodeWrap(String str, boolean dirReset) { // unicodeWrapBase does not HTML-escape, so its return value is not trusted. return SafeHtmlUtils.fromString(unicodeWrapBase(str, false, dirReset)); }
/** * Converts an input string into a SafeHtml. Input String must be safe (see * {@link com.google.gwt.safehtml.shared.SafeHtml}). * Implementation: first, tries to find the input in the static map, * {@link #cachedSafeHtmlValues}. If not found, creates a SafeHtml instance * for the string and adds it to the map. * * @param str String to search for. Must be safe (see * {@link com.google.gwt.safehtml.shared.SafeHtml}). * * @return Input as SafeHtml */ private SafeHtml cachedSafeHtml(String str) { if (cachedSafeHtmlValues == null) { cachedSafeHtmlValues = new HashMap<String, SafeHtml>(); } SafeHtml entry = cachedSafeHtmlValues.get(str); if (entry == null) { entry = SafeHtmlUtils.fromString(str); cachedSafeHtmlValues.put(str, entry); } return entry; } }
/** * @see BidiFormatter#unicodeWrapWithKnownDir( * com.google.gwt.i18n.client.HasDirection.Direction, String, boolean, boolean) * * @param dir {@code str}'s direction * @param str The input string * @param dirReset Whether to append a trailing unicode bidi mark matching the * context direction, when needed, to prevent the possible garbling * of whatever may follow {@code str} * @return Input string after applying the above processing. */ public SafeHtml unicodeWrapWithKnownDir(Direction dir, String str, boolean dirReset) { /* * unicodeWrapWithKnownDirBase does not HTML-escape, so its return value is * not trusted. */ return SafeHtmlUtils.fromString( unicodeWrapWithKnownDirBase(dir, str, false, dirReset)); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String name = method.getName(); String result = (args == null || args.length == 0) ? name : name + Arrays.asList(args); if (SafeHtml.class.isAssignableFrom(method.getReturnType())) { return SafeHtmlUtils.fromString(result); } return result; } }
public SafeHtml getName(T item) { String result = ""; if (item instanceof Nameable) { result = ((Nameable)item).getName(); } return SafeHtmlUtils.fromString(result); }
@Override public void render(final Context context, final String value, final SafeHtmlBuilder sb) { sb.append(SafeHtmlUtils.fromString(value)); } }
@Override public void setText(String text) { getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(text)); } }
@Override public SafeHtml render(ReportVisibilityDTO model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ReportVisibilityDTO> store, Grid<ReportVisibilityDTO> grid) { return SafeHtmlUtils.fromString(I18N.MESSAGES.databaseUserGroup(model.getDatabaseName())); } });
protected final Column findColumn(String name, String defaultValue, int maxLength) { int col = findColumnIndex(name); if (col == -1) { if (defaultValue == null) { missingColumns.add(name); } else if(!Strings.isNullOrEmpty(defaultValue)) { warnings.add(SafeHtmlUtils.fromString(I18N.MESSAGES.missingWithDefault(name, defaultValue))); } } return new Column(col, col == -1 ? name : source.getColumnHeader(col), defaultValue, maxLength); }
@Override public String getValue() { return SafeHtmlUtils.fromString(header.getElement().getInnerHTML()).asString(); } }
/** * Insert custom text inside the note zone. */ protected void insertText(Element e, String text) { $(e).materialnote("insertText", SafeHtmlUtils.fromString(text).asString()); }
@Override public SafeHtml getTooltip(DiskImage diskImage) { String status = EnumTranslator.getInstance().translate(diskImage.getImageStatus()); return SafeHtmlUtils.fromString(status); }
@Override public SafeHtml getTooltip() { SafeHtml tooltip = null; if (getDetailModel().isHotPlugAvailable() && !getDetailModel().isPlugAvailableByDisks(false)) { tooltip = SafeHtmlUtils.fromString(constants.diskHotPlugNotSupported()); } return tooltip; } };
@Override public void setValue(String value, boolean fireEvents) { value = SafeHtmlUtils.fromString(value).asString(); getElement().setInnerText(value); super.setValue(value, fireEvents); }
protected void applyIconStatus(MaterialIcon icon, String description) { iconError.removeFromParent(); iconSuccess.removeFromParent(); divCircle.removeFromParent(); conCircle.insert(icon, 0); if (description != null) { divDescription.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(description)); } }
private CheckBox buildCheckbox(final T checkBoxValue) { final CheckBox newCheckBox = new CheckBox(SafeHtmlUtils.fromString(renderer.render(checkBoxValue))); newCheckBox.setValue(false); newCheckBox.setStyleName(style.checkBox()); newCheckBox.addClickHandler(event -> { // ValueChangeEvent fired to notify the mapped ListModel about the new Selection/deselection. ValueChangeEvent.fire(CheckBoxGroup.this, getValue()); }); return newCheckBox; }