use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method createGeneralItemContainerPanel.
private Container createGeneralItemContainerPanel(VmNetworkInterface networkInterface) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.plugged()), renderPlugged(networkInterface.isPlugged()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.networkNameInterface()), SafeHtmlUtils.fromString(networkInterface.getNetworkName() != null ? networkInterface.getNetworkName() : ""), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.profileNameInterface()), SafeHtmlUtils.fromString(networkInterface.getVnicProfileName() != null ? networkInterface.getVnicProfileName() : ""), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.vmNetworkQosName()), SafeHtmlUtils.fromString(StringHelper.isNullOrEmpty(networkInterface.getQosName()) ? constants.notAvailableLabel() : networkInterface.getQosName()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.linkStateNetworkInterface()), renderLinkState(networkInterface.isLinked()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.typeInterface()), SafeHtmlUtils.fromString(VmInterfaceType.forValue(networkInterface.getType()).getDescription()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macInterface()), SafeHtmlUtils.fromString(networkInterface.getMacAddress()), dl);
addDetailItem(templates.sub(constants.speedInterface(), constants.mbps()), SafeHtmlUtils.fromString(String.valueOf(networkInterface.getSpeed())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.portMirroring()), renderPortMirroring(networkInterface.isPortMirroring()), dl);
column.getElement().appendChild(dl);
return createItemContainerPanel(content);
}
use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method createNetworkFilterParametersContainerPanel.
private Container createNetworkFilterParametersContainerPanel(List<VmNicFilterParameter> networkFilterParameters) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
networkFilterParameters.stream().forEach(parameter -> {
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameNetworkFilterParameter()), SafeHtmlUtils.fromString(parameter.getName()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.valueNetworkFilterParameter()), SafeHtmlUtils.fromString(parameter.getValue()), dl);
column.getElement().appendChild(dl);
});
return createItemContainerPanel(content);
}
use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.
the class VmSnapshotListViewItem method createGeneralItemContainerPanel.
private Container createGeneralItemContainerPanel(Snapshot snapshot, VmSnapshotListModel listModel) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.dateSnapshot()), SafeHtmlUtils.fromString(getCreateDateString(snapshot)), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.statusSnapshot()), SafeHtmlUtils.fromString(snapshot.getStatus().name()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.memorySnapshot()), SafeHtmlUtils.fromString(String.valueOf(snapshot.containsMemory())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.descriptionSnapshot()), SafeHtmlUtils.fromTrustedString(getDescription(snapshot)), dl);
VM entity = listModel.getEntity();
if (entity != null) {
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.definedMemoryVm()), SafeHtmlUtils.fromString(entity.getVmMemSizeMb() + constants.mb()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.physMemGauranteedVm()), SafeHtmlUtils.fromString(entity.getMinAllocatedMem() + constants.mb()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.numOfCpuCoresVm()), SafeHtmlUtils.fromString(messages.cpuInfoLabel(entity.getNumOfCpus(), entity.getNumOfSockets(), entity.getCpuPerSocket(), entity.getThreadsPerCpu())), dl);
}
column.getElement().appendChild(dl);
return createItemContainerPanel(content);
}
use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.
the class VmSnapshotListViewItem method createDisksItemContainerPanel.
private Container createDisksItemContainerPanel(List<DiskImage> diskImages) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
for (DiskImage image : diskImages) {
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.statusDisk()), SafeHtmlUtils.fromString(getImageStatus(image.getImageStatus())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.aliasDisk()), SafeHtmlUtils.fromString(image.getDiskAlias()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.provisionedSizeDisk()), SafeHtmlUtils.fromString(String.valueOf(sizeRenderer.render(image.getSize()))), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.sizeDisk()), SafeHtmlUtils.fromString(String.valueOf(sizeRenderer.render(image.getActualSizeInBytes()))), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.allocationDisk()), SafeHtmlUtils.fromString(String.valueOf(VolumeType.forValue(image.getVolumeType().getValue()))), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.interfaceDisk()), SafeHtmlUtils.fromString(getInterface(image)), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.creationDateDisk()), SafeHtmlUtils.fromString(dateRenderer.render(image.getCreationDate())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.diskSnapshotIDDisk()), SafeHtmlUtils.fromString(String.valueOf(image.getImageId())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.typeDisk()), SafeHtmlUtils.fromString(String.valueOf(image.getDiskStorageType())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.descriptionDisk()), SafeHtmlUtils.fromString(StringHelper.isNotNullOrEmpty(image.getDiskDescription()) ? image.getDiskDescription() : constants.notAvailableLabel()), dl);
column.getElement().appendChild(dl);
}
if (diskImages.isEmpty()) {
column.getElement().setInnerHTML(constants.noItemsToDisplay());
}
return createItemContainerPanel(content);
}
use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.
the class VmSnapshotListViewItem method createInstalledAppsItemContainerPanel.
private Container createInstalledAppsItemContainerPanel(List<String> appList) {
Row row = new Row();
Column column = new Column(ColumnSize.MD_12);
row.add(column);
Container container = createItemContainerPanel(row);
for (String appName : appList) {
column.getElement().setInnerHTML(appName);
row = new Row();
column = new Column(ColumnSize.MD_12);
row.add(column);
container.add(row);
}
if (appList.isEmpty()) {
column.getElement().setInnerHTML(constants.noItemsToDisplay());
}
return container;
}
Aggregations