Search in sources :

Example 6 with Container

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

Example 7 with Container

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

Example 8 with Container

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);
}
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 9 with Container

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);
}
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)

Example 10 with Container

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;
}
Also used : Container(org.gwtbootstrap3.client.ui.Container) Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row)

Aggregations

Column (org.gwtbootstrap3.client.ui.Column)13 Row (org.gwtbootstrap3.client.ui.Row)13 DListElement (com.google.gwt.dom.client.DListElement)7 Container (org.gwtbootstrap3.client.ui.Container)7 CellTable (com.google.gwt.user.cellview.client.CellTable)2 TextColumn (com.google.gwt.user.cellview.client.TextColumn)2 ListDataProvider (com.google.gwt.view.client.ListDataProvider)2 Button (org.gwtbootstrap3.client.ui.Button)2 Label (org.gwtbootstrap3.client.ui.Label)2 Span (org.gwtbootstrap3.client.ui.html.Span)2 RxTxRateRenderer (org.ovirt.engine.ui.common.widget.renderer.RxTxRateRenderer)2 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1