use of org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus in project ovirt-engine by oVirt.
the class GlusterVolumeSnapshotStatusColumn method getTooltip.
@Override
public SafeHtml getTooltip(GlusterVolumeSnapshotEntity snapshot) {
// Nothing to render if no snapshot is provided:
if (snapshot == null) {
return null;
}
// Find the image corresponding to the status of the brick:
GlusterSnapshotStatus status = snapshot.getStatus();
String tooltip;
switch(status) {
case ACTIVATED:
tooltip = constants.up();
break;
case DEACTIVATED:
tooltip = constants.down();
break;
case UNKNOWN:
tooltip = constants.unknown();
break;
default:
tooltip = constants.down();
}
return SafeHtmlUtils.fromSafeConstant(tooltip);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus in project ovirt-engine by oVirt.
the class GlusterVolumeSnapshotStatusCell method render.
@Override
public void render(Context context, GlusterVolumeSnapshotEntity snapshot, SafeHtmlBuilder sb, String id) {
// Nothing to render if no snapshot is provided:
if (snapshot == null) {
return;
}
// Find the image corresponding to the status of the brick:
GlusterSnapshotStatus status = snapshot.getStatus();
ImageResource statusImage = null;
switch(status) {
case ACTIVATED:
statusImage = resources.upImage();
break;
case DEACTIVATED:
statusImage = resources.downImage();
break;
case UNKNOWN:
statusImage = resources.questionMarkImage();
break;
default:
statusImage = resources.downImage();
}
// Generate the HTML for the image:
SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML());
sb.append(templates.statusTemplate(statusImageHtml, id, status.toString()));
}
Aggregations