Example usage for com.vaadin.ui CustomLayout setResponsive

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

Introduction

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

Prototype

public void setResponsive(boolean responsive) 

Source Link

Document

Toggles responsiveness of this component.

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());
    });//from   w w  w . j  a  va  2 s  .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);
}