Search in sources :

Example 46 with Column

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);
}
Also used : VmGuestAgentInterface(org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface) Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 47 with Column

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);
}
Also used : 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) RxTxTotalRenderer(org.ovirt.engine.ui.common.widget.renderer.RxTxTotalRenderer)

Example 48 with Column

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);
        }
    };
}
Also used : ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) Column(org.gwtbootstrap3.client.ui.Column) CheckBox(org.gwtbootstrap3.client.ui.CheckBox)

Example 49 with Column

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;
}
Also used : BigInteger(java.math.BigInteger) Set(java.util.Set) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) LimitedEntryDropDownManager(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.LimitedEntryDropDownManager) ListBox(org.gwtbootstrap3.client.ui.ListBox) LimitedEntryCol(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryCol)

Example 50 with Column

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);
}
Also used : IsWidget(com.google.gwt.user.client.ui.IsWidget) BRLActionVariableColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn) ListBox(org.gwtbootstrap3.client.ui.ListBox) Test(org.junit.Test)

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