@Override public void render(com.google.gwt.cell.client.Cell.Context context, TreePlace value, SafeHtmlBuilder sb) { if (value != null) { sb.appendEscaped(value.getName()); } } }
final public class ColumnHeaderFilterCell extends AbstractCell<String> { interface Templates extends SafeHtmlTemplates { @SafeHtmlTemplates.Template("<div class=\"headerText\">{0}</div>") SafeHtml text(String value); @SafeHtmlTemplates.Template("<div class=\"headerFilter\"><input type=\"text\" value=\"\"/></div>") SafeHtml filter(); } private static Templates templates = GWT.create(Templates.class); @Override public void render(Context context, String value, SafeHtmlBuilder sb) { if (value == null) { return; } SafeHtml renderedText = templates.text(value); sb.append(renderedText); SafeHtml renderedFilter = templates.filter(); sb.append(renderedFilter); } }
private static String composeUrl(String servletPath, String... params) { String ret = servletPath; ret = ret.replaceAll("[\\?&]+$", ""); String sep = ret.contains("?") ? "&" : "?"; for (String par : params) { ret += sep + par; sep = "&"; } for (Entry<String, List<String>> e : Window.Location.getParameterMap().entrySet()) { ret += sep + e.getKey() + "=" + e.getValue().get(0); } ret += sep + "random=" + Math.random(); return UriUtils.encode(ret); }
private void updateImageElementFromImageResource(Element imageSpan, ImageResource res, int spacing) { SafeUri url = res.getSafeUri(); int width = res.getWidth(); int height = res.getHeight(); int paddingRight = width + spacing; String style = "url(\"" + url.asString() + "\") no-repeat scroll left center"; imageSpan.getStyle().setProperty("background", style); imageSpan.getStyle().setPropertyPx("width", width); imageSpan.getStyle().setPropertyPx("height", height); imageSpan.getStyle().setPropertyPx("paddingRight", paddingRight); }
@Override protected float constructActions(DataGrid<T> table, float prefWidth) { float result = 0; if (downloadSchemaColumn == null || table.getColumnIndex(downloadSchemaColumn) == -1) { Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordSchema())); downloadSchemaColumn = constructDownloadSchemaColumn(); table.addColumn(downloadSchemaColumn, downloadRecordSchemaHeader); table.setColumnWidth(downloadSchemaColumn, 60, Unit.PX); result += 60; } return result; }
/** * Returns a {@link SafeHtml} containing the escaped string. * * @param s the input String * @return a {@link SafeHtml} instance */ public static SafeHtml fromString(String s) { return new SafeHtmlString(htmlEscape(s)); }
/** * Returns a {@link SafeUri} obtained by sanitizing the provided string. * * <p> * The input string is sanitized using {@link #sanitizeUri(String)}. * * @param s the input String * @return a SafeUri instance */ public static SafeUri fromString(String s) { return new SafeUriString(sanitizeUri(s)); }
int paddingRight = width + 8; String background = "url(\"" + uri.asString() + "\") no-repeat " + (-left + "px ") + (-top + "px");
@Override protected float constructActions(DataGrid<T> table, float prefWidth) { float result = 0; if (!embedded && (downloadSchemaColumn == null || table.getColumnIndex(downloadSchemaColumn) == -1)) { Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordSchema())); downloadSchemaColumn = constructDownloadSchemaColumn(""); table.addColumn(downloadSchemaColumn, downloadRecordSchemaHeader); table.setColumnWidth(downloadSchemaColumn, ACTION_COLUMN_WIDTH, Unit.PX); result += ACTION_COLUMN_WIDTH; } return result; }
@Override protected float constructActions(DataGrid<SdkProfileDto> table, float prefWidth) { float result = 0; if (enableActions) { if (generateSdkColumn == null || table.getColumnIndex(generateSdkColumn) == -1) { Header<SafeHtml> generateSdkHeader; generateSdkHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.generateSdk())); generateSdkColumn = constructGenerateSdkColumn(""); table.addColumn(generateSdkColumn, generateSdkHeader); table.setColumnWidth(generateSdkColumn, 40, Unit.PX); result += 40; } if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) { Header<SafeHtml> deleteHeader; if (embedded) { deleteHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.remove())); } else { deleteHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.delete())); } deleteColumn = constructDeleteColumn(""); table.addColumn(deleteColumn, deleteHeader); table.setColumnWidth(deleteColumn, 40, Unit.PX); result += 40; } } return result; }
@Override protected float constructActions(DataGrid<EndpointProfileDto> table, float prefWidth) { if (enableActions) { float result = 0; if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) { Header<SafeHtml> deleteHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant( embedded ? Utils.constants.remove() : Utils.constants.delete())); deleteColumn = constructDeleteColumn(""); table.addColumn(deleteColumn, deleteHeader); table.setColumnWidth(deleteColumn, 40, Style.Unit.PX); result += 40; } return result; } else { return 0; } }
@Override protected float constructActions(DataGrid<T> table, float prefWidth) { float result = 0; if (!embedded && (downloadPropsColumn == null || table.getColumnIndex(downloadPropsColumn) == -1)) { Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.configuration())); downloadPropsColumn = constructDownloadSchemaColumn(""); table.addColumn(downloadPropsColumn, downloadRecordSchemaHeader); table.setColumnWidth(downloadPropsColumn, ACTION_COLUMN_WIDTH, Unit.PX); result += ACTION_COLUMN_WIDTH; } result += super.constructActions(table, prefWidth); return result; }
@Override protected float constructActions(DataGrid<TopicDto> table, float prefWidth) { if (enableActions) { float result = 0; if (!embedded && (sendNotificationColumn == null || table.getColumnIndex(sendNotificationColumn) == -1)) { Header<SafeHtml> sendNotificationHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.sendNotification())); sendNotificationColumn = constructSendNotificationColumn(""); table.addColumn(sendNotificationColumn, sendNotificationHeader); table.setColumnWidth(sendNotificationColumn, 40, Unit.PX); result += 40; } if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) { Header<SafeHtml> deleteHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(embedded ? Utils.constants.remove() : Utils.constants.delete())); deleteColumn = constructDeleteColumn(""); table.addColumn(deleteColumn, deleteHeader); table.setColumnWidth(deleteColumn, 40, Unit.PX); result += 40; } return result; } else { return 0; } }
@Override protected float constructActions(DataGrid<ConfigurationSchemaDto> table, float prefWidth) { float result = super.constructActions(table, prefWidth); if (!embedded && (downloadBaseSchemaColumn == null || table.getColumnIndex(downloadBaseSchemaColumn) == -1)) { Header<SafeHtml> downloadBaseSchemaHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadBaseSchema())); downloadBaseSchemaColumn = constructDownloadBaseSchemaColumnColumn(""); table.addColumn(downloadBaseSchemaColumn, downloadBaseSchemaHeader); table.setColumnWidth(downloadBaseSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX); result += ACTION_COLUMN_WIDTH; } if (!embedded && (downloadOverrideSchemaColumn == null || table.getColumnIndex(downloadOverrideSchemaColumn) == -1)) { Header<SafeHtml> downloadOverrideSchemaHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadOverrideSchema())); downloadOverrideSchemaColumn = constructDownloadOverrideSchemaColumnColumn(""); table.addColumn(downloadOverrideSchemaColumn, downloadOverrideSchemaHeader); table.setColumnWidth(downloadOverrideSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX); result += ACTION_COLUMN_WIDTH; } return result; }
@Override protected float constructActions(DataGrid<LogSchemaDto> table, float prefWidth) { float result = super.constructActions(table, prefWidth); if (!embedded && (downloadLibraryColumn == null || table.getColumnIndex(downloadLibraryColumn) == -1)) { Header<SafeHtml> downloadLibraryHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordLibrary())); downloadLibraryColumn = constructDownloadLibraryColumn(""); table.addColumn(downloadLibraryColumn, downloadLibraryHeader); table.setColumnWidth(downloadLibraryColumn, ACTION_COLUMN_WIDTH, Unit.PX); result += ACTION_COLUMN_WIDTH; } if (enableActions) { if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) { Header<SafeHtml> deleteHeader = new SafeHtmlHeader( SafeHtmlUtils.fromSafeConstant( embedded ? Utils.constants.remove() : Utils.constants.delete())); deleteColumn = constructDeleteColumn(""); table.addColumn(deleteColumn, deleteHeader); table.setColumnWidth(deleteColumn, ACTION_COLUMN_WIDTH, Unit.PX); result += ACTION_COLUMN_WIDTH; } } return result; }
SafeHtmlUtils.fromSafeConstant(Utils.constants.action()));
SafeHtmlUtils.fromSafeConstant(Utils.messages.loginTitle()));
getCancelButtonWidget().setText(Utils.constants.cancel()); requiredFieldsNoteLabel.getElement().setInnerSafeHtml( SafeHtmlUtils.fromSafeConstant(Utils.messages .requiredFieldsNote(Utils.avroUiStyle .requiredField())));