use of com.google.gwt.user.client.ui.Image in project perun by CESNET.
the class PerunAppStateCell method render.
@Override
public void render(com.google.gwt.cell.client.Cell.Context context, String status, SafeHtmlBuilder sb) {
// selects the image according to the status
ImageResource ir = null;
if (status.equalsIgnoreCase("NEW")) {
ir = NEW;
} else if (status.equalsIgnoreCase("VERIFIED")) {
ir = VERIFIED;
} else if (status.equalsIgnoreCase("APPROVED")) {
ir = APPROVED;
} else if (status.equalsIgnoreCase("REJECTED")) {
ir = REJECTED;
}
// if status not available
if (ir == null) {
return;
}
// append the image
Element imageElement = new Image(ir).getElement();
imageElement.setTitle(status);
SafeHtml image = SafeHtmlUtils.fromSafeConstant((imageElement.getString()));
sb.appendHtmlConstant("<div class=\"" + "customClickableTextCell" + "\">");
sb.append(image);
sb.appendHtmlConstant("</div>");
}
use of com.google.gwt.user.client.ui.Image in project perun by CESNET.
the class PerunAppTypeCell method render.
@Override
public void render(com.google.gwt.cell.client.Cell.Context context, String status, SafeHtmlBuilder sb) {
// selects the image according to the status
ImageResource ir = null;
if (status.equalsIgnoreCase("INITIAL")) {
ir = INITIAL;
} else if (status.equalsIgnoreCase("EXTENSION")) {
ir = EXTENSION;
}
// if status not available
if (ir == null) {
return;
}
// append the image
Element imageElement = new Image(ir).getElement();
imageElement.setTitle(status);
SafeHtml image = SafeHtmlUtils.fromSafeConstant((imageElement.getString()));
sb.appendHtmlConstant("<div class=\"" + "customClickableTextCell" + "\">");
sb.append(image);
sb.appendHtmlConstant("</div>");
}
use of com.google.gwt.user.client.ui.Image in project perun by CESNET.
the class WhetherEnabledCell method render.
@Override
public void render(com.google.gwt.cell.client.Cell.Context context, Boolean enabled, SafeHtmlBuilder sb) {
// selects the image according to the status
ImageResource ir = null;
if (enabled) {
ir = ENABLED;
} else {
ir = DISABLED;
}
// if status not available
if (ir == null) {
return;
}
// append the image
Element imageElement = new Image(ir).getElement();
imageElement.setTitle(String.valueOf(enabled));
SafeHtml image = SafeHtmlUtils.fromSafeConstant((imageElement.getString()));
sb.append(image);
}
use of com.google.gwt.user.client.ui.Image in project gerrit by GerritCodeReview.
the class DashboardsTable method populate.
protected void populate(final int row, final DashboardInfo k) {
if (k.isDefault()) {
table.setWidget(row, 1, new Image(Gerrit.RESOURCES.greenCheck()));
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.getElement(row, 1).setTitle(Util.C.dashboardDefaultToolTip());
}
table.setWidget(row, 2, new Anchor(k.path(), "#" + PageLinks.toProjectDashboard(new Project.NameKey(k.project()), k.id())));
table.setText(row, 3, k.title() != null ? k.title() : k.path());
table.setText(row, 4, k.description());
if (k.definingProject() != null && !k.definingProject().equals(k.project())) {
table.setWidget(row, 5, new Anchor(k.definingProject(), "#" + PageLinks.toProjectDashboards(new Project.NameKey(k.definingProject()))));
}
setRowItem(row, k);
}
use of com.google.gwt.user.client.ui.Image in project gerrit by GerritCodeReview.
the class StringListPanel method setInfo.
public void setInfo(String msg) {
if (info == null && titlePanel != null) {
info = new Image(Gerrit.RESOURCES.info());
titlePanel.add(info);
}
if (info != null) {
info.setTitle(msg);
}
}
Aggregations