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