@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; }
@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<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<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<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<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<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())));
/** * Get the HTML representation of an image. Visible for testing. * * @param res the {@link ImageResource} to render as HTML * @param valign the vertical alignment * @param isPlaceholder if true, do not include the background image * @return the rendered HTML */ SafeHtml getImageHtml(ImageResource res, VerticalAlignmentConstant valign, boolean isPlaceholder) { // Get the HTML for the image. SafeHtml image; if (isPlaceholder) { image = SafeHtmlUtils.fromSafeConstant("<div></div>"); } else { AbstractImagePrototype proto = AbstractImagePrototype.create(res); image = proto.getSafeHtml(); } // Create the wrapper based on the vertical alignment. SafeStylesBuilder cssStyles = new SafeStylesBuilder().appendTrustedString(direction + ":0px;"); if (HasVerticalAlignment.ALIGN_TOP == valign) { return template.imageWrapperTop(cssStyles.toSafeStyles(), image); } else if (HasVerticalAlignment.ALIGN_BOTTOM == valign) { return template.imageWrapperBottom(cssStyles.toSafeStyles(), image); } else { int halfHeight = (int) Math.round(res.getHeight() / 2.0); cssStyles.appendTrustedString("margin-top:-" + halfHeight + "px;"); return template.imageWrapperMiddle(cssStyles.toSafeStyles(), image); } }
public static <T> SelectionColumn<T> createAndAddSelectionColumn(DataGrid<T> dataGrid) { SelectionColumn<T> selectionColumn = new SelectionColumn<T>(dataGrid); dataGrid.addColumn(selectionColumn, SafeHtmlUtils.fromSafeConstant("<br>")); return selectionColumn; }
@Override protected MenuItem instanciate(Class<? extends MenuItem> clazz, Map<String, Object> attributes, Object owner) { if (clazz == MenuItem.class) { return new MenuItem(SafeHtmlUtils.fromSafeConstant("")); } return super.instanciate(clazz, attributes, owner); }
public CloseButton() { super(SafeHtmlUtils.fromSafeConstant("×")); setStyleName("close"); getButtonElement().setAttribute("aria-hidden", "true"); } }
public LocationMap(LocationSearchPresenter presenter, NewLocationPresenter newLocationPresenter) { super(); this.searchPresenter = presenter; this.newLocationPresenter = newLocationPresenter; LeafletResourceInjector.ensureInjected(); setStyleName("gwt-Map"); setHtml(SafeHtmlUtils.fromSafeConstant("<div style=\"width:100%; height: 100%; position: relative;\"></div>")); }
@Override public SafeHtml getTooltip(EntityModel object) { Disk disk = ((DiskModel) object.getEntity()).getDisk(); if (disk.isShareable()) { return SafeHtmlUtils.fromSafeConstant(constants.shareable()); } return null; } }, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())),
@Override public SafeHtml getTooltip(EntityModel object) { Disk disk = ((DiskModel) object.getEntity()).getDisk(); if (disk.isShareable()) { return SafeHtmlUtils.fromSafeConstant(constants.shareable()); } return null; } }, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())),
@Override public SafeHtml getTooltip(EntityModel object) { Disk disk = ((DiskModel) object.getEntity()).getDisk(); if (disk.isShareable()) { return SafeHtmlUtils.fromSafeConstant(constants.shareable()); } return null; } }, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())),
private Column createInfoColumn(String headerValue, boolean withBorder) { Column column = new Column(ColumnSize.MD_4); if (withBorder) { column.addStyleName(VM_NIC_INFO_COLUMN); } Div header = new Div(); header.addStyleName(VM_NIC_INFO_HEADING); header.getElement().setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant(headerValue)); column.add(header); return column; }