Search in sources :

Example 6 with DListElement

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

the class VmSnapshotListViewItem method createNicsItemContainerPanel.

private Container createNicsItemContainerPanel(List<VmNetworkInterface> nics) {
    RxTxRateRenderer rateRenderer = new RxTxRateRenderer();
    Row content = new Row();
    Container container = createItemContainerPanel(content);
    int i = 0;
    for (VmNetworkInterface nic : nics) {
        if (i % 4 == 0 && i > 0) {
            content = new Row();
            container.add(content);
        }
        Column column = new Column(calculateColSize(i));
        content.add(column);
        DListElement dl = Document.get().createDLElement();
        dl.addClassName(DL_HORIZONTAL);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameInterface()), SafeHtmlUtils.fromString(nic.getName()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.networkNameInterface()), SafeHtmlUtils.fromString(nic.getNetworkName()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.profileNameInterface()), SafeHtmlUtils.fromString(nic.getVnicProfileName()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.typeInterface()), SafeHtmlUtils.fromString(VmInterfaceType.forValue(nic.getType()).getDescription()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macInterface()), SafeHtmlUtils.fromString(nic.getMacAddress()), dl);
        addDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { nic.getStatistics().getReceiveRate(), nic.hasSpeed() ? nic.getSpeed().doubleValue() : 0 })), dl);
        addDetailItem(templates.sub(constants.txRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { nic.getStatistics().getTransmitRate(), nic.hasSpeed() ? nic.getSpeed().doubleValue() : 0 })), dl);
        addDetailItem(templates.sub(constants.dropsInterface(), constants.pkts()), SafeHtmlUtils.fromString(String.valueOf(nic.getStatistics().getReceiveDropRate() != null ? nic.getStatistics().getReceiveDropRate() : "" + nic.getStatistics().getTransmitDropRate())), dl);
        column.getElement().appendChild(dl);
        i++;
    }
    if (nics.isEmpty()) {
        Column column = new Column(ColumnSize.MD_12);
        content.add(column);
        column.getElement().setInnerHTML(constants.noItemsToDisplay());
    }
    return container;
}
Also used : Container(org.gwtbootstrap3.client.ui.Container) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Column(org.gwtbootstrap3.client.ui.Column) RxTxRateRenderer(org.ovirt.engine.ui.common.widget.renderer.RxTxRateRenderer) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement)

Example 7 with DListElement

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

the class HostNetworkInterfaceListViewItem method createRxColumn.

private IsWidget createRxColumn(HostInterface hostInterface) {
    Column rxCol = new Column(ColumnSize.SM_3);
    DListElement dl = Document.get().createDLElement();
    addReverseDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { hostInterface.getRxRate(), hostInterface.getSpeed().doubleValue() })), dl);
    dl.addClassName(Styles.PULL_LEFT);
    rxCol.getElement().appendChild(dl);
    FlowPanel divider = new FlowPanel();
    divider.addStyleName(RATE_DIVIDER);
    rxCol.add(divider);
    dl = Document.get().createDLElement();
    addReverseDetailItem(templates.sub(constants.rxTotal(), constants.bytes()), SafeHtmlUtils.fromString(totalRenderer.render(hostInterface.getRxTotal())), dl);
    dl.addClassName(Styles.PULL_LEFT);
    rxCol.getElement().appendChild(dl);
    return rxCol;
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) AbstractIconTypeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn) TextColumn(com.google.gwt.user.cellview.client.TextColumn) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) DListElement(com.google.gwt.dom.client.DListElement)

Example 8 with DListElement

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

the class HostNetworkInterfaceListViewItem method createMacColumn.

private IsWidget createMacColumn(VdsNetworkInterface hostInterface) {
    Column macCol = new Column(ColumnSize.SM_2);
    DListElement dl = Document.get().createDLElement();
    addReverseDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macInterface()), SafeHtmlUtils.fromString(hostInterface.getMacAddress() != null ? hostInterface.getMacAddress() : constants.unAvailablePropertyLabel()), dl);
    macCol.getElement().appendChild(dl);
    return macCol;
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) AbstractIconTypeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn) TextColumn(com.google.gwt.user.cellview.client.TextColumn) DListElement(com.google.gwt.dom.client.DListElement)

Example 9 with DListElement

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

the class HostNetworkInterfaceListViewItem method createTxColumn.

private IsWidget createTxColumn(HostInterface hostInterface) {
    Column txCol = new Column(ColumnSize.SM_3);
    DListElement dl = Document.get().createDLElement();
    addReverseDetailItem(templates.sub(constants.txRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { hostInterface.getTxRate(), hostInterface.getSpeed().doubleValue() })), dl);
    dl.addClassName(Styles.PULL_LEFT);
    txCol.getElement().appendChild(dl);
    FlowPanel divider = new FlowPanel();
    divider.addStyleName(RATE_DIVIDER);
    txCol.add(divider);
    dl = Document.get().createDLElement();
    addReverseDetailItem(templates.sub(constants.txTotal(), constants.bytes()), SafeHtmlUtils.fromString(totalRenderer.render(hostInterface.getTxTotal())), dl);
    dl.addClassName(Styles.PULL_LEFT);
    txCol.getElement().appendChild(dl);
    return txCol;
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) AbstractIconTypeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn) TextColumn(com.google.gwt.user.cellview.client.TextColumn) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) DListElement(com.google.gwt.dom.client.DListElement)

Example 10 with DListElement

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

the class PatternflyListViewItem method addStackedDetailItem.

protected void addStackedDetailItem(SafeHtml label, SafeHtml value, DListElement parent) {
    // $NON-NLS-1$
    Element dt = Document.get().createElement("dt");
    // $NON-NLS-1$
    dt.setInnerSafeHtml(label);
    parent.appendChild(dt);
    dt.addClassName(STACKED_DETAIL_ITEM);
    dt.getStyle().setFloat(Style.Float.LEFT);
    dt.getStyle().setPaddingRight(5, Unit.PX);
    // $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)

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