Refine search
/** * Create the content for the login form with the supplied user name field, * password field and the login button. You cannot use any other text fields * or buttons for this purpose. To replace these components with your own * implementations, override {@link #createUsernameField()}, * {@link #createPasswordField()} and {@link #createLoginButton()}. If you * only want to change the default captions, override * {@link #getUsernameCaption()}, {@link #getPasswordCaption()} and * {@link #getLoginButtonCaption()}. You do not have to use the login button * in your layout. * * @param userNameField * the user name text field * @param passwordField * the password field * @param loginButton * the login button * @return content component * @since 7.7 */ protected Component createContent(TextField userNameField, PasswordField passwordField, Button loginButton) { VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.addComponent(userNameField); layout.addComponent(passwordField); layout.addComponent(loginButton); return layout; }
/** * Creates the select tab. * * @return the component */ private Component createSelectTab() { VerticalLayout selLayout = new VerticalLayout(); selLayout.setMargin(new MarginInfo(false, false, true, false)); selLayout.addComponent(selPreview); selLayout.addStyleName("seltab"); colorSelect = new ColorPickerSelect(); colorSelect.addValueChangeListener(this::colorChanged); selLayout.addComponent(colorSelect); return selLayout; }
@Override protected Component initContent() { VerticalLayout layout = new VerticalLayout(); setStyleName("colorselect"); setWidth("100%"); range = new ComboBox<>(null, EnumSet.allOf(ColorRange.class)); range.setEmptySelectionAllowed(false); range.setWidth("100%"); range.addValueChangeListener(this::valueChange); range.setValue(ColorRange.ALL); layout.addComponent(range); grid = new ColorPickerGrid(createAllColors(14, 10)); grid.setWidth("100%"); grid.addValueChangeListener(this::fireEvent); layout.addComponent(grid); return layout; }
VerticalLayout hsvLayout = new VerticalLayout(); hsvLayout.setMargin(new MarginInfo(false, false, true, false)); hsvLayout.addComponent(hsvPreview); hsvLayout.setStyleName("hsvtab"); hsvGradient.setValue(color); hsvGradient.addValueChangeListener(this::colorChanged); hsvLayout.addComponent(hsvGradient); selectors.add(hsvGradient); VerticalLayout sliders = new VerticalLayout(); sliders.setStyleName("hsv-sliders"); sliders.addComponent(hueSlider); sliders.addComponent(saturationSlider); sliders.addComponent(valueSlider); hsvLayout.addComponent(sliders);
VerticalLayout rgbLayout = new VerticalLayout(); rgbLayout.setMargin(new MarginInfo(false, false, true, false)); rgbLayout.addComponent(rgbPreview); rgbLayout.setStyleName("rgbtab"); rgbGradient.setValue(color); rgbGradient.addValueChangeListener(this::colorChanged); rgbLayout.addComponent(rgbGradient); selectors.add(rgbGradient); VerticalLayout sliders = new VerticalLayout(); sliders.setStyleName("rgb-sliders"); sliders.addComponent(redSlider); sliders.addComponent(greenSlider); sliders.addComponent(blueSlider); rgbLayout.addComponent(sliders);
layout.addComponent(tabs); VerticalLayout innerContainer = new VerticalLayout(); innerContainer.setWidth("100%"); innerContainer.setHeight(null); innerContainer.addComponent(history); VerticalLayout outerContainer = new VerticalLayout(); outerContainer.setWidth("99%"); outerContainer.setHeight("27px"); outerContainer.addComponent(innerContainer); historyContainer = outerContainer; layout.addComponent(historyContainer); resize.setHeight("10px"); resize.setPrimaryStyleName("resize-button"); layout.addComponent(resize); buttons.setComponentAlignment(ok, Alignment.MIDDLE_CENTER); buttons.setComponentAlignment(cancel, Alignment.MIDDLE_CENTER); layout.addComponent(buttons); setRgbSliderValues(selectedColor);
public static VerticalLayout VERTICAL(final Component...components) { VerticalLayout layout = new VerticalLayout(); //layout.addStyleName(Style.Rating.FIELDS); for (Component component : components) { if (component != null) { layout.addComponent(component); } } return layout; }
import com.vaadin.server.VaadinRequest; import com.vaadin.ui.*; @Theme("mytheme") public class MyApplicationUI extends UI { @Override protected void init(VaadinRequest request) { VerticalLayout view = new VerticalLayout(); view.addComponent(new Label("Hello Vaadin!")); setContent(view); } }
@Override public Component initContent() { final VerticalLayout layout = new VerticalLayout(); layout.addComponent(table); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT); return layout; }
@Override public Component initContent() { VerticalLayout layout = new VerticalLayout(); layout.addComponent(table); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT); return layout; }
@Override public Component initContent() { VerticalLayout layout = new VerticalLayout(); layout.addComponent(table); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT); return layout; }
public static VerticalLayout wrapPagedTable(I18NSource messageSource, LocalizedPagedTable table) { VerticalLayout tableCarrier = new VerticalLayout(); tableCarrier.setWidth(100, Sizeable.UNITS_PERCENTAGE); tableCarrier.addComponent(table); tableCarrier.addComponent(tableControls(messageSource, table)); return tableCarrier; }
public static Layout FORM(final Component...components) { VerticalLayout layout = new VerticalLayout(); //layout.addStyleName(Style.Rating.FIELDS); for (Component component : components) { if (component != null) { component.setWidth(100.0f, Unit.PERCENTAGE); layout.addComponent(component); } } return layout; }
public static VerticalLayout VERTICAL(final String style, final Component...components) { VerticalLayout layout = new VerticalLayout(); if (style != null) { layout.addStyleName(style); } for (Component component : components) { if (component != null) { layout.addComponent(component); } } return layout; }
@Override protected Layout wrapFields() { VerticalLayout vl = new VerticalLayout(); vl.addComponent(dateField); HorizontalLayout hl = new HorizontalLayout(); hl.addComponent(timeField); hl.setComponentAlignment(timeField, Alignment.MIDDLE_CENTER); vl.addComponent(hl); return vl; }
@Override public Component getComponent() { VerticalLayout verticalLayout = new VerticalLayout(); Label label = new Label("The specified dashlet could not be found!"); verticalLayout.addComponent(label); verticalLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER); return verticalLayout; } };
private Layout createContent(final String description) { VerticalLayout content = new VerticalLayout(); content.setWidth(100, Unit.PERCENTAGE); Layout footer = createFooter(); Layout mainArea = createMainArea(description); content.addComponent(mainArea); content.addComponent(footer); content.setExpandRatio(mainArea, 1); return content; }
private void refreshWindow(ComponentContainer header, ComponentContainer windowContainer) { mainWindow.removeAllComponents(); VerticalLayout main = new VerticalLayout(); main.setMargin(true); main.setSpacing(true); main.addComponent(header); main.addComponent(windowContainer); mainWindow.setContent(main); }
private Layout createContent(final String description) { VerticalLayout content = new VerticalLayout(); content.setWidth(100, Unit.PERCENTAGE); Layout footer = createFooter(); Layout mainArea = createMainArea(description); content.addComponent(mainArea); content.addComponent(footer); content.setExpandRatio(mainArea, 1); return content; }
VerticalLayout vlMain = new VerticalLayout(); vlMain.setSizeFull(); HorizontalLayout hlFooter = new HorizontalLayout(); hlFooter.setHeight("50px"); // if you want you can define a height. hlFooter.addComponent(new Label("Test1")); // adding a simple component. You might want to set alignment for that component vlMain.addComponent(mainComponent); vlMain.setExpandRatio(mainComponent, 1.0f); // "give" the main component the maximum available space vlMain.addComponent(hlFooter);