use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class AlertPanel method updateBadge.
private void updateBadge() {
badge.setVisible(count != 1);
badgeText.setText(String.valueOf(count));
if (badge.isVisible()) {
SafeHtmlBuilder builder = new SafeHtmlBuilder();
for (SafeHtml message : messagesList) {
builder.append(message);
}
alertTooltip.setHtml(builder.toSafeHtml());
}
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class AbstractImageCell method render.
@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));
}
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class ColumnResizeCellTable method addColumnImpl.
private void addColumnImpl(Column<T, ?> column, Header<?> header) {
// build resizable headers, if necessary
if (columnResizingEnabled && header instanceof AbstractCheckboxHeader) {
header = createResizableCheckboxHeader(header, column);
} else if (columnResizingEnabled) {
header = createResizableHeader(column, header);
} else if (applyHeaderStyle && header instanceof SafeHtmlHeader) {
SafeHtmlHeader safeHtmlHeader = (SafeHtmlHeader) header;
// not using Resizeable header, but still want it to look that way.
// nonResizeableColumnHeader does that.
// TODO nonResizeableColumnHeader copy-pastes CSS. fix.
SafeHtml newValue = templates.nonResizeableColumnHeader(safeHtmlHeader.getValue());
header = new SafeHtmlHeader(newValue, safeHtmlHeader.getTooltip());
}
// actually add the column
super.addColumn(column, header);
// Add empty no-width column as the last column
if (columnResizingEnabled) {
if (isColumnPresent(emptyNoWidthColumn)) {
removeColumn(emptyNoWidthColumn);
}
super.addColumn(emptyNoWidthColumn, emptyNoWidthColumnHeader);
}
// Add column to header context menu
if (header instanceof AbstractHeader) {
((AbstractHeader) header).setContextMenuHandler(ensureContextMenuHandler());
contextPopup.getContextMenu().addItem(column);
}
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class ItemInfoPopup method generatePreviewSentence.
private String generatePreviewSentence() {
SafeHtml host = templates.strongTextWithColor(constants.hostForOutOfSyncSentence(), SafeStylesUtils.forTrustedColor(WHITE_TEXT_COLOR));
SafeHtml dc = templates.strongTextWithColor(constants.dcForOutOfSyncSentence(), SafeStylesUtils.forTrustedColor(WHITE_TEXT_COLOR));
SafeHtml outOfSyncPreviewSentence = templates.coloredText(constants.hostOutOfSyncPreviewSentence(), SafeStylesUtils.forTrustedColor(TEXT_COLOR));
return templates.hostOutOfSyncPreviewSentence(host, outOfSyncPreviewSentence, dc).asString();
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class ItemInfoPopup method addSyncDiff.
/**
* @param networkModel must be managed
*/
private void addSyncDiff(LogicalNetworkModel networkModel) {
addRow(templates.imageTextSetupNetwork(notInSyncImage, templates.coloredText(constants.hostOutOfSync(), SafeStylesUtils.forTrustedColor(TEXT_COLOR))));
SafeHtml safeHtml = SafeHtmlUtils.fromTrustedString(generatePreviewSentence());
addRow(safeHtml);
List<ReportedConfiguration> panelParameters = filterSyncProperties(networkModel);
Widget networkOutOfSyncPanel = new NetworkOutOfSyncPanel(panelParameters).outOfSyncTableAsWidget();
contents.insertRow(contents.getRowCount());
contents.setWidget(contents.getRowCount(), 0, networkOutOfSyncPanel);
}
Aggregations