use of com.google.gwt.dom.client.DListElement in project ovirt-engine by oVirt.
the class PatternflyListViewItem method addReverseDetailItem.
protected void addReverseDetailItem(SafeHtml label, SafeHtml value, DListElement parent) {
// $NON-NLS-1$
Element dt = Document.get().createElement("dt");
// $NON-NLS-1$
dt.setInnerSafeHtml(value);
parent.appendChild(dt);
// $NON-NLS-1$
Element dd = Document.get().createElement("dd");
dd.setInnerSafeHtml(label);
parent.appendChild(dd);
}
use of com.google.gwt.dom.client.DListElement in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method createGuestAgentContainerPanel.
private Container createGuestAgentContainerPanel(VmNetworkInterface networkInterface, List<VmGuestAgentInterface> allGuestAgentData) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
for (VmGuestAgentInterface guestAgentInterface : allGuestAgentData) {
if (guestAgentInterface.getMacAddress() != null && guestAgentInterface.getMacAddress().equals(networkInterface.getMacAddress())) {
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameVmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getInterfaceName()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv4VmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getIpv4Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv4Addresses()) : constants.notAvailableLabel()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv6VmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getIpv6Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv6Addresses()) : constants.notAvailableLabel()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macVmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getMacAddress()), dl);
column.getElement().appendChild(dl);
}
}
if (allGuestAgentData.isEmpty()) {
Span noDataSpan = new Span();
noDataSpan.setText(constants.notAvailableLabel());
column.add(noDataSpan);
}
return createItemContainerPanel(content);
}
use of com.google.gwt.dom.client.DListElement in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method addNetworkMainInfo.
protected void addNetworkMainInfo(VmNetworkInterface networkInterface, HasWidgets targetPanel) {
DListElement dl = Document.get().createDLElement();
FlowPanel infoPanel = new FlowPanel();
StringJoiner ipv4AddressJoiner = new StringJoiner(COMMA_DELIMITER);
StringJoiner ipv6AddressJoiner = new StringJoiner(COMMA_DELIMITER);
for (VmGuestAgentInterface guestAgentInterface : allGuestAgentData) {
if (guestAgentInterface.getMacAddress() != null && networkInterface.getMacAddress().equals(guestAgentInterface.getMacAddress())) {
if (guestAgentInterface.getIpv4Addresses() != null) {
ipv4AddressJoiner.add(String.join(COMMA_DELIMITER, guestAgentInterface.getIpv4Addresses()));
}
if (guestAgentInterface.getIpv6Addresses() != null) {
ipv6AddressJoiner.add(String.join(COMMA_DELIMITER, guestAgentInterface.getIpv6Addresses()));
}
}
}
String ipv4Address = ipv4AddressJoiner.toString();
if (ipv4Address.isEmpty()) {
ipv4Address = constants.notAvailableLabel();
}
String ipv6Address = ipv6AddressJoiner.toString();
if (ipv6Address.isEmpty()) {
ipv6Address = constants.notAvailableLabel();
}
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.networkNameInterface()), SafeHtmlUtils.fromString(networkInterface.getNetworkName() != null ? networkInterface.getNetworkName() : constants.unAvailablePropertyLabel()), dl);
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv4VmGuestAgent()), SafeHtmlUtils.fromString(ipv4Address), dl);
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv6VmGuestAgent()), SafeHtmlUtils.fromString(ipv6Address), dl);
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macVmGuestAgent()), SafeHtmlUtils.fromString(networkInterface.getMacAddress()), dl);
infoPanel.getElement().appendChild(dl);
targetPanel.add(infoPanel);
}
use of com.google.gwt.dom.client.DListElement in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method createStatisticsItemContainerPanel.
private Container createStatisticsItemContainerPanel(VmNetworkInterface networkInterface) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
RxTxRateRenderer rateRenderer = new RxTxRateRenderer();
RxTxTotalRenderer totalRenderer = new RxTxTotalRenderer();
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { networkInterface.getStatistics().getReceiveRate(), networkInterface.hasSpeed() ? networkInterface.getSpeed().doubleValue() : 0 })), dl);
addDetailItem(templates.sub(constants.txRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { networkInterface.getStatistics().getTransmitRate(), networkInterface.hasSpeed() ? networkInterface.getSpeed().doubleValue() : 0 })), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.rxTotal()), SafeHtmlUtils.fromString(totalRenderer.render(networkInterface.getStatistics().getReceivedBytes())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.txTotal()), SafeHtmlUtils.fromString(totalRenderer.render(networkInterface.getStatistics().getTransmittedBytes())), dl);
addDetailItem(templates.sub(constants.dropsInterface(), constants.pkts()), SafeHtmlUtils.fromString(String.valueOf(networkInterface.getStatistics().getReceiveDropRate() + networkInterface.getStatistics().getTransmitDropRate())), dl);
column.getElement().appendChild(dl);
return createItemContainerPanel(content);
}
Aggregations