Example usage for com.vaadin.ui CustomLayout addComponent

List of usage examples for com.vaadin.ui CustomLayout addComponent

Introduction

In this page you can find the example usage for com.vaadin.ui CustomLayout addComponent.

Prototype

@Override
public void addComponent(Component c) 

Source Link

Document

Adds the component into this container.

Usage

From source file:org.airline.CelestiaLogin.java

@Override
protected void init(VaadinRequest request) {
    //Vista final para la UI
    final VerticalLayout layout = new VerticalLayout();

    Panel loginPanel = new Panel("Login");
    CustomLayout login = new CustomLayout("LoginLayout");
    //Seccin de Vista del Login
    //VerticalLayout login=new VerticalLayout(); 
    Label label = new Label("Iniciar Sesin / Registrarse");
    TextField user = new TextField("", "Usuario");
    TextField passwd = new TextField("", "Contrasea");

    Button init_session = new Button("Iniciar Sesin");
    init_session.setStyleName(ValoTheme.BUTTON_PRIMARY);
    init_session.addClickListener(cliqueo -> {
        Notification.show("Bienvenido " + user.getValue());
    });/*www . j a v a  2s . c o  m*/

    login.addComponent(label);
    login.addComponent(user);
    login.addComponent(passwd);
    login.addComponent(init_session);
    login.setWidth("500px");
    //login.setMargin(true);
    login.setResponsive(true);

    layout.addComponent(login);
    layout.setComponentAlignment(login, Alignment.MIDDLE_CENTER);
    setContent(login);
}