Search in sources :

Example 11 with Column

use of org.gwtbootstrap3.client.ui.Column 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 12 with Column

use of org.gwtbootstrap3.client.ui.Column in project ovirt-engine by oVirt.

the class HostNetworkInterfaceListViewItem method createDropRateColumn.

private IsWidget createDropRateColumn(HostInterface hostInterface) {
    Column dropRateCol = new Column(ColumnSize.SM_2);
    dropRateCol.addStyleName(NIC_SPEED_DROP);
    dropRateCol.add(createDropRateIcon());
    Span valueSpan = new Span();
    valueSpan.getElement().setInnerSafeHtml(templates.dropRate(hostInterface.getRxDrop() + hostInterface.getTxDrop()));
    dropRateCol.add(valueSpan);
    return dropRateCol;
}
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) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 13 with Column

use of org.gwtbootstrap3.client.ui.Column in project ovirt-engine by oVirt.

the class HostNetworkInterfaceListViewItem method createSpeedColumn.

private IsWidget createSpeedColumn(VdsNetworkInterface hostInterface) {
    Column speedCol = new Column(ColumnSize.SM_2);
    speedCol.addStyleName(NIC_SPEED_DROP);
    speedCol.add(createSpeedIcon());
    Span valueSpan = new Span();
    if (hostInterface.hasSpeed()) {
        valueSpan.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(templates.nicSpeed(hostInterface.getSpeed()).asString()));
    } else {
        valueSpan.setText(constants.unAvailablePropertyLabel());
    }
    speedCol.add(valueSpan);
    return speedCol;
}
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) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 14 with Column

use of org.gwtbootstrap3.client.ui.Column 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 15 with Column

use of org.gwtbootstrap3.client.ui.Column 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)

Aggregations

Column (org.gwtbootstrap3.client.ui.Column)30 Row (org.gwtbootstrap3.client.ui.Row)24 Column (com.google.gwt.user.cellview.client.Column)17 ButtonCell (org.gwtbootstrap3.client.ui.gwt.ButtonCell)12 DListElement (com.google.gwt.dom.client.DListElement)10 Button (org.gwtbootstrap3.client.ui.Button)9 TextColumn (com.google.gwt.user.cellview.client.TextColumn)8 Element (com.google.gwt.dom.client.Element)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)5 AbstractIconTypeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn)5 AbstractCell (com.google.gwt.cell.client.AbstractCell)4 ValueUpdater (com.google.gwt.cell.client.ValueUpdater)4 NativeEvent (com.google.gwt.dom.client.NativeEvent)4 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)4 HTMLButtonElement (elemental2.dom.HTMLButtonElement)4 Container (org.gwtbootstrap3.client.ui.Container)4 Icon (org.gwtbootstrap3.client.ui.Icon)4 Label (org.gwtbootstrap3.client.ui.Label)4 CellTable (com.google.gwt.user.cellview.client.CellTable)3 ListDataProvider (com.google.gwt.view.client.ListDataProvider)3