use of org.gwtbootstrap3.client.ui.Column 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 org.gwtbootstrap3.client.ui.Column 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);
}
use of org.gwtbootstrap3.client.ui.Column in project drools-wb by kiegroup.
the class AuditLogViewImpl method makeEventTypeCheckBox.
private Widget makeEventTypeCheckBox(final String eventType, final Boolean isEnabled) {
final CheckBox chkEventType = new CheckBox(AuditLogEntryCellHelper.getEventTypeDisplayText(eventType));
chkEventType.setValue(Boolean.TRUE.equals(isEnabled));
chkEventType.addValueChangeHandler((ValueChangeEvent<Boolean> event) -> {
auditLog.getAuditLogFilter().getAcceptedTypes().put(eventType, event.getValue());
});
// BZ-996942: Use one column layout.
chkEventType.setWordWrap(false);
return new Column(ColumnSize.MD_2) {
{
add(chkEventType);
}
};
}
use of org.gwtbootstrap3.client.ui.Column in project drools-wb by kiegroup.
the class DTCellValueWidgetFactory method makeListBoxForColumn.
private ListBox makeListBoxForColumn(final DropDownData dd, final Pattern52 basePattern, final BaseColumn baseCondition, final DTCellValue52 dcv, final boolean isMultipleSelect) {
final ListBox lb = makeListBox(dd, isMultipleSelect, dcv);
// Wire up update handler
lb.setEnabled(!isReadOnly);
if (!isReadOnly) {
lb.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
String value = null;
if (lb.isMultipleSelect()) {
for (int i = 0; i < lb.getItemCount(); i++) {
if (lb.isItemSelected(i)) {
if (value == null) {
value = lb.getValue(i);
} else {
value = value + "," + lb.getValue(i);
}
}
}
} else {
int index = lb.getSelectedIndex();
if (index > -1) {
// Set base column value
value = lb.getValue(index);
}
}
dcv.setStringValue(value);
// Update any dependent enumerations
final LimitedEntryDropDownManager.Context context = new LimitedEntryDropDownManager.Context(basePattern, baseCondition);
Set<Integer> dependentColumnIndexes = dropDownManager.getDependentColumnIndexes(context);
for (Integer iCol : dependentColumnIndexes) {
BaseColumn column = model.getExpandedColumns().get(iCol);
if (column instanceof LimitedEntryCol) {
((LimitedEntryCol) column).setValue(null);
} else if (column instanceof DTColumnConfig52) {
((DTColumnConfig52) column).setDefaultValue(null);
}
}
}
});
}
return lb;
}
use of org.gwtbootstrap3.client.ui.Column in project drools-wb by kiegroup.
the class DTCellValueWidgetFactoryTest method testGetWidgetEnumsForBRLColumn.
@Test
public void testGetWidgetEnumsForBRLColumn() throws Exception {
BRLActionVariableColumn column = mock(BRLActionVariableColumn.class);
doReturn("Person").when(column).getFactType();
doReturn("name").when(column).getFactField();
when(oracle.hasEnums("Person", "name")).thenReturn(true);
IsWidget widget = factory.getWidget(column, cellValue);
assertTrue(widget instanceof ListBox);
}
Aggregations