Search in sources :

Example 1 with DListElement

use of com.google.gwt.dom.client.DListElement in project ovirt-engine by oVirt.

the class PatternflyListViewItem method addDetailItem.

protected void addDetailItem(SafeHtml label, SafeHtml value, DListElement parent) {
    // $NON-NLS-1$
    Element dt = Document.get().createElement("dt");
    // $NON-NLS-1$
    dt.setInnerSafeHtml(label);
    parent.appendChild(dt);
    // $NON-NLS-1$
    Element dd = Document.get().createElement("dd");
    dd.setInnerSafeHtml(value);
    parent.appendChild(dd);
}
Also used : DListElement(com.google.gwt.dom.client.DListElement) Element(com.google.gwt.dom.client.Element)

Example 2 with DListElement

use of com.google.gwt.dom.client.DListElement 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);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement)

Example 3 with DListElement

use of com.google.gwt.dom.client.DListElement 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);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement)

Example 4 with DListElement

use of com.google.gwt.dom.client.DListElement 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);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) VM(org.ovirt.engine.core.common.businessentities.VM) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement)

Example 5 with DListElement

use of com.google.gwt.dom.client.DListElement 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);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Aggregations

DListElement (com.google.gwt.dom.client.DListElement)14 Column (org.gwtbootstrap3.client.ui.Column)10 Row (org.gwtbootstrap3.client.ui.Row)7 Element (com.google.gwt.dom.client.Element)3 TextColumn (com.google.gwt.user.cellview.client.TextColumn)3 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)3 AbstractIconTypeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn)3 VmGuestAgentInterface (org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface)2 RxTxRateRenderer (org.ovirt.engine.ui.common.widget.renderer.RxTxRateRenderer)2 StringJoiner (java.util.StringJoiner)1 Container (org.gwtbootstrap3.client.ui.Container)1 Span (org.gwtbootstrap3.client.ui.html.Span)1 VM (org.ovirt.engine.core.common.businessentities.VM)1 VmNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)1 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)1 RxTxTotalRenderer (org.ovirt.engine.ui.common.widget.renderer.RxTxTotalRenderer)1