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