Search in sources :

Example 1 with RadioButton

use of org.gwtbootstrap3.client.ui.RadioButton in project drools-wb by kiegroup.

the class FileExtensionSelector method addRadioButtons.

private void addRadioButtons() {
    boolean first = true;
    for (String resourceSuffix : this.resourceTypes.keySet()) {
        Radio radioButton = new Radio(FILE_TYPE);
        radioButton.setText(resourceSuffix);
        radioButton.setValue(first);
        first = false;
        radioButtonList.add(radioButton);
        add(radioButton);
    }
}
Also used : Radio(org.gwtbootstrap3.client.ui.Radio)

Example 2 with RadioButton

use of org.gwtbootstrap3.client.ui.RadioButton in project ovirt-engine by oVirt.

the class RadioButtonPanel method createRadioButton.

private RadioButton createRadioButton(String title, boolean active, boolean enabled, ValueChangeHandler<Boolean> handler) {
    RadioButton button = new RadioButton(title);
    button.setHTML(title);
    button.setName(name);
    button.setEnabled(enabled);
    button.setActive(active);
    button.addValueChangeHandler(handler);
    return button;
}
Also used : RadioButton(org.gwtbootstrap3.client.ui.RadioButton)

Example 3 with RadioButton

use of org.gwtbootstrap3.client.ui.RadioButton in project ovirt-engine by oVirt.

the class HostPopupView method createSpmControls.

private void createSpmControls(final HostModel object) {
    Row labelRow = (Row) spmContainer.getWidget(0);
    spmContainer.clear();
    spmContainer.add(labelRow);
    Iterable<?> items = object.getSpmPriority().getItems();
    if (items == null) {
        return;
    }
    // Recreate SPM related controls.
    for (Object item : items) {
        @SuppressWarnings("unchecked") final EntityModel<Integer> model = (EntityModel<Integer>) item;
        // $//$NON-NLS-1$
        RadioButton rb = new RadioButton("spm");
        rb.setText(model.getTitle());
        Element labelElement = (Element) rb.getElement().getChild(1);
        labelElement.addClassName(style.patternFlyRadio());
        rb.setValue(object.getSpmPriority().getSelectedItem() == model);
        rb.addValueChangeHandler(e -> object.getSpmPriority().setSelectedItem(model));
        Row row = new Row();
        Column column = new Column(ColumnSize.SM_12, rb);
        row.add(column);
        spmContainer.add(row);
    }
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Element(com.google.gwt.dom.client.Element) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) Row(org.gwtbootstrap3.client.ui.Row) RadioButton(com.google.gwt.user.client.ui.RadioButton)

Example 4 with RadioButton

use of org.gwtbootstrap3.client.ui.RadioButton in project ovirt-engine by oVirt.

the class DisksContentTypeRadioGroup method getRadioGroupPanel.

private Widget getRadioGroupPanel() {
    buttonToType = new LinkedHashMap<>();
    // $NON-NLS-1$
    RadioButton allButton = new RadioButton(BUTTON_GROUP_NAME);
    buttonToType.put(allButton, null);
    allButton.setText(constants.allDisksLabel());
    for (DiskContentType contentType : DiskContentType.values()) {
        // $NON-NLS-1$
        RadioButton button = new RadioButton(BUTTON_GROUP_NAME);
        buttonToType.put(button, contentType);
    }
    ButtonGroup buttonGroup = new ButtonGroup();
    buttonGroup.setDataToggle(Toggle.BUTTONS);
    buttonToType.entrySet().forEach(e -> {
        buttonGroup.add(e.getKey());
        e.getKey().addClickHandler(event -> fireChangeHandlers(e.getValue()));
    });
    setDiskContentType(null);
    localize();
    // $NON-NLS-1$
    buttonGroup.addStyleName("disk-type-buttons-group");
    return buttonGroup;
}
Also used : DiskContentType(org.ovirt.engine.core.common.businessentities.storage.DiskContentType) ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) RadioButton(org.gwtbootstrap3.client.ui.RadioButton)

Example 5 with RadioButton

use of org.gwtbootstrap3.client.ui.RadioButton in project ovirt-engine by oVirt.

the class DisksViewRadioGroup method getRadioGroupPanel.

private Widget getRadioGroupPanel() {
    allButton = new RadioButton(GROUP_NAME);
    allButton.setText(constants.allDisksLabel());
    allButton.setActive(true);
    allButton.addClickHandler(event -> fireChangeHandlers(null));
    imagesButton = new RadioButton(GROUP_NAME);
    imagesButton.setText(constants.imageDisksLabel());
    imagesButton.addClickHandler(event -> fireChangeHandlers(DiskStorageType.IMAGE));
    lunsButton = new RadioButton(GROUP_NAME);
    lunsButton.setText(constants.lunDisksLabel());
    lunsButton.addClickHandler(event -> fireChangeHandlers(DiskStorageType.LUN));
    cinderButton = new RadioButton(GROUP_NAME);
    cinderButton.setText(constants.cinderDisksLabel());
    cinderButton.addClickHandler(event -> fireChangeHandlers(DiskStorageType.CINDER));
    ButtonGroup buttonGroup = new ButtonGroup();
    buttonGroup.setDataToggle(Toggle.BUTTONS);
    buttonGroup.add(allButton);
    buttonGroup.add(imagesButton);
    buttonGroup.add(lunsButton);
    buttonGroup.add(cinderButton);
    // $NON-NLS-1$
    buttonGroup.addStyleName("disk-type-buttons-group");
    return buttonGroup;
}
Also used : ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) RadioButton(org.gwtbootstrap3.client.ui.RadioButton)

Aggregations

RadioButton (org.gwtbootstrap3.client.ui.RadioButton)4 ButtonGroup (org.gwtbootstrap3.client.ui.ButtonGroup)3 Element (com.google.gwt.dom.client.Element)1 RadioButton (com.google.gwt.user.client.ui.RadioButton)1 Column (org.gwtbootstrap3.client.ui.Column)1 Radio (org.gwtbootstrap3.client.ui.Radio)1 Row (org.gwtbootstrap3.client.ui.Row)1 DiskContentType (org.ovirt.engine.core.common.businessentities.storage.DiskContentType)1 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)1