use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class VmTypeColumn method getImagesToTooltipTextMap.
private Map<SafeHtml, String> getImagesToTooltipTextMap(VM vm) {
Map<SafeHtml, String> res = new LinkedHashMap<>();
if (vm.getVmPoolId() == null) {
VmTypeConfig config = VmTypeConfig.from(vm.getVmType(), vm.isStateless(), vm.isNextRunConfigurationExists());
res.put(getImageSafeHtml(config.getImageResource()), config.getTooltip());
} else {
ImageResource img = getPoolVmImageResource(vm.getVmType(), vm.isNextRunConfigurationExists());
res.put(getImageSafeHtml(img), getPoolVmTooltip(vm.getVmType()));
}
if (vm.isHostedEngine()) {
res.put(getImageSafeHtml(resources.mgmtNetwork()), constants.isHostedEngineVmTooltip());
}
return res;
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class StorageDeviceStatusCell method render.
@Override
public void render(Context context, StorageDevice device, SafeHtmlBuilder sb, String id) {
// No lock if we can create brick from the device
if (device.getCanCreateBrick()) {
return;
}
// Place a lock image to say that device is already in use and can't be used again
SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(resources.lockImage()).getHTML());
sb.append(templates.statusTemplate(statusImageHtml, id, ""));
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class VmCountColumn method createInOutMigrationsTemplate.
protected SafeHtml createInOutMigrationsTemplate(int migrations, SafeHtml arrowImage) {
String prefix;
String postfix;
String migrationsStr;
SafeHtml image;
if (migrations > 0) {
// $NON-NLS-1$
prefix = "(";
migrationsStr = String.valueOf(migrations);
image = arrowImage;
// $NON-NLS-1$
postfix = ")";
} else {
// $NON-NLS-1$
prefix = "\u00a0";
// $NON-NLS-1$
migrationsStr = "\u00a0";
image = SafeHtmlUtils.EMPTY_SAFE_HTML;
// $NON-NLS-1$
postfix = "\u00a0";
}
return templates.vmCountInOutMigrations(prefix, migrationsStr, image, postfix);
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class AssignedVNumaNodesPanel method setNodes.
public void setNodes(Collection<VNodeModel> virtualNodes, int numaNodeIndex, List<VdsNumaNode> numaNodeList) {
String myImageHtml = AbstractImagePrototype.create(resources.vNumaTitleIcon()).getHTML();
SafeHtml mySafeImageHtml = new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(myImageHtml);
if (virtualNodes == null) {
virtualNodes = new ArrayList<>();
}
SafeHtml title = titleTemplate.title(virtualNodes.size(), mySafeImageHtml, style.numaTitle());
collapsiblePanel.setTitleWidget(new HTML(title));
scrollPanel.setIndex(numaNodeIndex);
scrollPanel.clear();
for (VNodeModel nodeModel : virtualNodes) {
DraggableVirtualNumaPanel numaNodePanel = virtualNumaPanelProvider.get();
numaNodePanel.setModel(nodeModel, numaNodeList);
scrollPanel.add(numaNodePanel);
}
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class NumaSupportPopupView method getHostSummaryTitle.
@Override
public IsWidget getHostSummaryTitle(int totalCpus, int usedCpuPercentage, int totalMemory, int usedMemory, int totalNumaNodes, int totalVNumaNodes) {
FlowPanel summaryPanel = new FlowPanel();
CpuSummaryPanel cpuSummaryPanel = this.cpuSummaryPanelProvider.get();
cpuSummaryPanel.setName(constants.numaSummaryTotals());
cpuSummaryPanel.setCpus(totalCpus, usedCpuPercentage);
summaryPanel.add(cpuSummaryPanel);
MemorySummaryPanel memorySummaryPanel = this.memorySummaryPanelProvider.get();
memorySummaryPanel.setMemoryStats(totalMemory, usedMemory);
summaryPanel.add(memorySummaryPanel);
summaryPanel.add(new HTML(numaTitleTemplate.title(totalNumaNodes, style.hostSummaryNumaTitle())));
String myImageHtml = AbstractImagePrototype.create(resources.vNumaTitleIcon()).getHTML();
SafeHtml mySafeImageHtml = new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(myImageHtml);
summaryPanel.add(new HTML(vNumaTitleTemplate.title(totalVNumaNodes, mySafeImageHtml, style.hostSummaryNumaTitle())));
return summaryPanel;
}
Aggregations