Java 类com.vaadin.ui.LoginForm.LoginEvent 实例源码

项目:GPIO_Vaadin_Project    文件:Rpi_gpio_controllerApplication.java   
private void createLoginUI(final AbstractOrderedLayout parentLayout) {
    final Rpi_gpio_controllerApplication application = this;

    LoginForm loginForm = new LoginForm();
    loginForm.addListener(new LoginForm.LoginListener() {
        Rpi_gpio_controllerApplication mApplication = application;

           public void onLogin(LoginEvent event) {
            String loginErrorMessage = new User(new UserData (event.getLoginParameter("username"), event.getLoginParameter("password")), mApplication).login();
            if (loginErrorMessage != null) {                                        
                Notification notification = new Notification(LoginErrorMessage, loginErrorMessage, Notification.TYPE_ERROR_MESSAGE);
                notification.setDelayMsec(1000);
                getMainWindow().showNotification(notification);
               }
           }
       });

    Panel loginPanel = new Panel("Log in");
    loginPanel.setWidth("200px");
    loginPanel.setHeight("250px");
    loginPanel.addComponent(loginForm);

       parentLayout.addComponent(loginPanel);
       parentLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
}
项目:SecureBPMN    文件:LoginPage.java   
public void onLogin(LoginEvent event) {
  String userName = event.getLoginParameter("username"); // see the input field names in CustomLoginForm
  String password = event.getLoginParameter("password");  // see the input field names in CustomLoginForm
  // Delegate authentication to handler
  LoggedInUser loggedInUser = loginHandler.authenticate(userName, password);
  if (loggedInUser != null) {
    ExplorerApp.get().setUser(loggedInUser);
    viewManager.showDefaultPage();
  } else {
    refreshUi();
    notificationManager.showErrorNotification(Messages.LOGIN_FAILED_HEADER, i18nManager.getMessage(Messages.LOGIN_FAILED_INVALID));
  }
}
项目:FiWare-Template-Handler    文件:LoginPage.java   
public void onLogin(LoginEvent event) {
  String userName = event.getLoginParameter("username"); // see the input field names in CustomLoginForm
  String password = event.getLoginParameter("password");  // see the input field names in CustomLoginForm
  // Delegate authentication to handler
  LoggedInUser loggedInUser = loginHandler.authenticate(userName, password);
  if (loggedInUser != null) {
    ExplorerApp.get().setUser(loggedInUser);
    viewManager.showDefaultPage();
  } else {
    refreshUi();
    notificationManager.showErrorNotification(Messages.LOGIN_FAILED_HEADER, i18nManager.getMessage(Messages.LOGIN_FAILED_INVALID));
  }
}