use of com.vaadin.flow.component.login.LoginForm in project iesi by metadew.
the class LoginScreen method buildUI.
private void buildUI() {
setSizeFull();
setClassName("login-screen");
// login form, centered in the available part of the screen
LoginForm loginForm = new LoginForm();
loginForm.addLoginListener(this::login);
loginForm.addForgotPasswordListener(event -> Notification.show("Contact your framework administrator"));
// layout to center login form when there is sufficient screen space
FlexLayout centeringLayout = new FlexLayout();
centeringLayout.setSizeFull();
centeringLayout.setJustifyContentMode(JustifyContentMode.CENTER);
centeringLayout.setAlignItems(Alignment.CENTER);
centeringLayout.add(loginForm);
// information text about logging in
Component loginInformation = buildLoginInformation();
add(loginInformation);
add(centeringLayout);
}
use of com.vaadin.flow.component.login.LoginForm in project bookstore-example by vaadin.
the class LoginScreen method buildUI.
private void buildUI() {
setSizeFull();
setClassName("login-screen");
// login form, centered in the available part of the screen
LoginForm loginForm = new LoginForm();
loginForm.addLoginListener(this::login);
loginForm.addForgotPasswordListener(event -> Notification.show("Hint: same as username"));
// layout to center login form when there is sufficient screen space
FlexLayout centeringLayout = new FlexLayout();
centeringLayout.setSizeFull();
centeringLayout.setJustifyContentMode(JustifyContentMode.CENTER);
centeringLayout.setAlignItems(Alignment.CENTER);
centeringLayout.add(loginForm);
// information text about logging in
Component loginInformation = buildLoginInformation();
add(loginInformation);
add(centeringLayout);
}
Aggregations