Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ru.pochta.abon.cabinet.ui.layout;
- import com.vaadin.ui.*;
- import java.util.List;
- public abstract class CustomRadioButtonLayout extends CssLayout{
- List<Object> icons;
- List<String> captions;
- List<String> descriptions;
- void initLayout() {
- setPrimaryStyleName("customRadioButtonLayout");
- HorizontalLayout placeholder = new HorizontalLayout();
- HorizontalLayout layout = new HorizontalLayout();
- System.out.println("caps:" + captions.size());
- captions.forEach(System.out::println);
- for (int i = 0; i < 3; i++) {
- VerticalLayout radioButton = new VerticalLayout();
- radioButton.addStyleName("customRadioButtonLayout");
- radioButton.addStyleName("radioButton");
- Component icon = new Label("icon " + i);
- radioButton.addComponent(icon);
- radioButton.setComponentAlignment(icon, Alignment.MIDDLE_CENTER);
- Component caption = new Label("label " + i);
- radioButton.addComponent(caption);
- radioButton.setComponentAlignment(caption, Alignment.MIDDLE_CENTER);
- Component description = new Label("descr " + i);
- radioButton.addComponent(description);
- layout.addComponent(radioButton);
- layout.setComponentAlignment(radioButton, Alignment.MIDDLE_CENTER);
- }
- placeholder.addComponent(layout);
- placeholder.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);
- this.addComponent(placeholder);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment