Search in sources :

Example 6 with ButtonGroup

use of org.gwtbootstrap3.client.ui.ButtonGroup 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 7 with ButtonGroup

use of org.gwtbootstrap3.client.ui.ButtonGroup 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)

Example 8 with ButtonGroup

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

the class ViewRadioGroup method getRadioGroupPanel.

private Widget getRadioGroupPanel() {
    ButtonGroup buttonGroup = new ButtonGroup();
    buttonGroup.setDataToggle(Toggle.BUTTONS);
    for (ViewFilter<K> item : items) {
        RadioButton radioButton = new RadioButton(GROUP_NAME);
        radioButton.setText(item.getText());
        radioButton.addClickHandler(event -> fireChangeHandlers(item.getValue()));
        buttons.put(item.getValue(), radioButton);
        buttonGroup.add(radioButton);
    }
    setSelectedValue(items.get(0).getValue());
    return buttonGroup;
}
Also used : ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) RadioButton(org.gwtbootstrap3.client.ui.RadioButton)

Example 9 with ButtonGroup

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

the class TagsView method addChildTags.

private void addChildTags(List<TagModel> tagModels, HasWidgets group, final int indent) {
    int newIndent = indent + 1;
    for (TagModel model : tagModels) {
        ListGroupItem tagItem = new ListGroupItem();
        tagItem.getElement().getStyle().setPaddingLeft(indent * INDENT_WIDTH, Unit.PX);
        ButtonGroup buttonGroup = new ButtonGroup();
        buttonGroup.add(createActivateButton(model));
        buttonGroup.add(createAddButton(model));
        buttonGroup.add(createEditButton(model));
        buttonGroup.add(createRemoveButton(model));
        buttonGroup.addStyleName(Styles.PULL_RIGHT);
        tagItem.add(buttonGroup);
        tagItem.setText(model.getName().getEntity());
        group.add(tagItem);
        List<TagModel> children = model.getChildren();
        if (children != null && !children.isEmpty()) {
            addChildTags(model.getChildren(), group, newIndent);
        }
    }
}
Also used : ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) ListGroupItem(org.gwtbootstrap3.client.ui.ListGroupItem) TagModel(org.ovirt.engine.ui.uicommonweb.models.tags.TagModel)

Aggregations

ButtonGroup (org.gwtbootstrap3.client.ui.ButtonGroup)9 Button (org.gwtbootstrap3.client.ui.Button)5 DropDownMenu (org.gwtbootstrap3.client.ui.DropDownMenu)5 MenuItem (org.uberfire.workbench.model.menu.MenuItem)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)4 ApplicationScoped (javax.enterprise.context.ApplicationScoped)4 Inject (javax.inject.Inject)4 AnchorListItem (org.gwtbootstrap3.client.ui.AnchorListItem)4 ButtonSize (org.gwtbootstrap3.client.ui.constants.ButtonSize)4 IconType (org.gwtbootstrap3.client.ui.constants.IconType)4 Toggle (org.gwtbootstrap3.client.ui.constants.Toggle)4 MenuUtils (org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils)4 RadioButton (org.gwtbootstrap3.client.ui.RadioButton)3 IconPosition (org.gwtbootstrap3.client.ui.constants.IconPosition)2 Pull (org.gwtbootstrap3.client.ui.constants.Pull)2 ClientTranslationService (org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService)2 Command (org.uberfire.mvp.Command)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Widget (com.google.gwt.user.client.ui.Widget)1