@Override public final SafeHtml getValue(Snapshot snapshot) { // Get raw description string (ignore < and > characters). // Customize description style as needed. SafeHtml description = SafeHtmlUtils.fromString(snapshot.getDescription()); String descriptionStr = description.asString(); if (snapshot.getStatus() == SnapshotStatus.IN_PREVIEW) { List<String> previewedItems = new ArrayList<>(Arrays.asList(constants.vmConfiguration())); previewedItems.addAll(Linq.getDiskAliases(snapshot.getDiskImages())); descriptionStr = messages.snapshotPreviewing( descriptionStr, StringUtils.join(previewedItems, ", ")); // $NON-NLS-1$ description = templates.snapshotDescription("color:orange", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.STATELESS) { descriptionStr = descriptionStr + " (" + constants.readonlyLabel() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ description = templates.snapshotDescription("font-style:italic", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.PREVIEW) { descriptionStr = constants.snapshotDescriptionActiveVmBeforePreview(); description = templates.snapshotDescription("color:gray", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.ACTIVE) { descriptionStr = constants.snapshotDescriptionActiveVm(); description = templates.snapshotDescription("color:gray", descriptionStr); // $NON-NLS-1$ } else if (snapshot.getType() == SnapshotType.REGULAR && !snapshot.getDiskImages().isEmpty()) { descriptionStr = messages.snapshotPreviewing( descriptionStr, StringUtils.join( Linq.getDiskAliases(snapshot.getDiskImages()), ", ")); // $NON-NLS-1$ description = templates.snapshotDescription("color:gold", descriptionStr); // $NON-NLS-1$ } return description; }