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;
}
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;
}
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;
}
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);
}
}
}
Aggregations