Java Code Examples for com.vaadin.ui.OptionGroup#addStyleName()

The following examples show how to use com.vaadin.ui.OptionGroup#addStyleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout createApprovalLayout() {
    approveButtonsGroup = new OptionGroup();
    approveButtonsGroup.setId(UIComponentIdProvider.ROLLOUT_APPROVAL_OPTIONGROUP_ID);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    approveButtonsGroup.addStyleName("custom-option-group");
    approveButtonsGroup.addItems(Rollout.ApprovalDecision.APPROVED, Rollout.ApprovalDecision.DENIED);

    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.APPROVED, i18n.getMessage(APPROVAL_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.APPROVED, FontAwesome.CHECK);
    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.DENIED, i18n.getMessage(DENY_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.DENIED, FontAwesome.TIMES);

    approvalRemarkField = createTextField("label.approval.remark",
            UIComponentIdProvider.ROLLOUT_APPROVAL_REMARK_FIELD_ID, Rollout.APPROVAL_REMARK_MAX_SIZE);
    approvalRemarkField.setWidth(100.0F, Unit.PERCENTAGE);

    final HorizontalLayout layout = new HorizontalLayout(approveButtonsGroup, approvalRemarkField);
    layout.setWidth(100.0F, Unit.PERCENTAGE);
    layout.setExpandRatio(approvalRemarkField, 1.0F);
    return layout;
}
 
Example 2
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private OptionGroup createErrorThresholdOptionGroup() {
    final OptionGroup errorThresoldOptions = new OptionGroup();
    for (final ERROR_THRESHOLD_OPTIONS option : ERROR_THRESHOLD_OPTIONS.values()) {
        errorThresoldOptions.addItem(option.getValue(i18n));
    }
    errorThresoldOptions.setId(UIComponentIdProvider.ROLLOUT_ERROR_THRESOLD_OPTION_ID);
    errorThresoldOptions.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    errorThresoldOptions.addStyleName(SPUIStyleDefinitions.ROLLOUT_OPTION_GROUP);
    errorThresoldOptions.setSizeUndefined();
    errorThresoldOptions.addValueChangeListener(this::listenerOnErrorThresoldOptionChange);
    return errorThresoldOptions;
}
 
Example 3
Source File: AbstractSoftwareModuleTypeLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void assignOptionGroupByValues(final List<String> tagOptions) {
    assignOptiongroup = new OptionGroup("", tagOptions);
    assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
    assignOptiongroup.addStyleName("custom-option-group");
    assignOptiongroup.setNullSelectionAllowed(false);
    assignOptiongroup.setId(UIComponentIdProvider.ASSIGN_OPTION_GROUP_SOFTWARE_MODULE_TYPE_ID);
    assignOptiongroup.select(tagOptions.get(0));
}