Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.PasswordTextBox


                                                       constants.Login() );

        final TextBox userName = new TextBox();
        pop.addAttribute( constants.UserName(),
                          userName );
        final PasswordTextBox password = new PasswordTextBox();
        pop.addAttribute( constants.Password(),
                          password );

        KeyPressHandler kph = new KeyPressHandler() {
            public void onKeyPress(KeyPressEvent event) {
                if ( KeyCodes.KEY_ENTER == event.getNativeEvent().getKeyCode() ) {
                    doLogin( userName,
                             password,
                             pop );
                }
            }
        };
        userName.addKeyPressHandler( kph );
        password.addKeyPressHandler( kph );

        Button b = new Button( constants.OK() );
        b.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
                doLogin( userName,
View Full Code Here


                           userNameInput );

        layoutB.setHTML( 4,
                         0,
                         "Password:" );
        final PasswordTextBox userPassInput = new PasswordTextBox();
        if ( rdbmsConf.getDbPass() != null && rdbmsConf.getDbPass().trim().length() > 0 ) {
            userPassInput.setValue( rdbmsConf.getDbPass() );
        }
        userPassInput.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent w) {
                repoDisplayArea.setVisible( false );
                saveRepoConfigForm.setVisible( false );
            }
        } );
        layoutB.setWidget( 4,
                           1,
                           userPassInput );

        Button generateButton = new Button( constants.GenerateRepositoryConfiguration() );
        generateButton.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent w) {
                if ( driverInput.getValue() == null || driverInput.getValue().trim().length() < 1 ) {
                    Window.alert( constants.PleaseEnterDriver() );
                    return;
                } else if ( urlInput.getValue() == null || urlInput.getValue().trim().length() < 1 ) {
                    Window.alert( constants.PleaseEnterUrl() );
                    return;
                } else if ( userNameInput.getValue() == null || userNameInput.getValue().trim().length() < 1 ) {
                    Window.alert( constants.PleaseEnterUserName() );
                    return;
                } else if ( userPassInput.getValue() == null || userPassInput.getValue().trim().length() < 1 ) {
                    Window.alert( constants.PleaseEnterPassword() );
                    return;
                }
                rdbmsConf.setDbDriver( driverInput.getValue() );
                rdbmsConf.setDbUrl( urlInput.getValue() );
                rdbmsConf.setDbUser( userNameInput.getValue() );
                rdbmsConf.setDbPass( userPassInput.getValue() );
                //rdbmsConf.setJndiDsName(jndiNameInput.getValue());
                generateConfig();
            }
        } );
        layoutB.setWidget( 5,
View Full Code Here

    private InputElementWrapper wrapper;

    public PasswordBoxItem(String name, String title) {
        super(name, title);

        textBox = new PasswordTextBox();
        textBox.setName(name);
        textBox.setTitle(title);

        wrapper = new InputElementWrapper(textBox, this);
    }
View Full Code Here

public class PTPasswordTextBox extends PTTextBox {

    @Override
    public void create(final PTInstruction create, final UIService uiService) {
        init(create, uiService, new PasswordTextBox());
    }
View Full Code Here

    private InputElementWrapper wrapper;

    public PasswordBoxItem(String name, String title) {
        super(name, title);

        textBox = new PasswordTextBox();
        textBox.setName(name);
        textBox.setTitle(title);

        wrapper = new InputElementWrapper(textBox, this);
    }
View Full Code Here

    final VerticalPanel popupContents = new VerticalPanel();
    final Label usernameLabel = new Label("Nom d'utilisateur *");
    final TextBox usernameTextBox = new TextBox();
    usernameTextBox.setMaxLength(255);
    final Label passwordLabel = new Label("Mot de passe *");
    final PasswordTextBox passwordTextBox = new PasswordTextBox();
    passwordTextBox.setMaxLength(255);
    final HorizontalPanel buttonPanel = new HorizontalPanel();

    final Button okButton = new Button("OK");
    final Button signupButton = new Button("Inscription");

    // Fill popup contents
    popupContents.add(usernameLabel);
    popupContents.add(usernameTextBox);
    popupContents.add(passwordLabel);
    popupContents.add(passwordTextBox);
    buttonPanel.add(okButton);
    buttonPanel.add(signupButton);
    buttonPanel.setSpacing(5);
    popupContents.add(buttonPanel);
    loginSignupPopup.setWidget(popupContents);

    // Popup ok button
    okButton.addClickHandler(new ClickHandler() {

      @Override
      public void onClick(ClickEvent event) {

        // Retrieve field values
        String username = usernameTextBox.getText().trim();
        String password = passwordTextBox.getText().trim();

        // Validate field values
        try {
          Validator.validateLogin(username, password);

          // Log user in
          logIn(username, password);
        } catch (Exception caught) {

          if (caught instanceof RequiredFieldException) {

            Window.alert(PdpScanner.REQUIRED_FIELDS_ERROR);
          } else {

            Window.alert(LOGIN_USER_ERROR);
          }
        }
      }
    });

    // Popup password textbox
    passwordTextBox.addKeyPressHandler(new KeyPressHandler() {

      @Override
      public void onKeyPress(KeyPressEvent event) {

        if (event.getCharCode() == 13) {
View Full Code Here

    mailTextBox.setMaxLength(255);
    final Label usernameLabel = new Label("Nom d'utilisateur *");
    final TextBox usernameTextBox = new TextBox();
    usernameTextBox.setMaxLength(255);
    final Label passwordLabel = new Label("Mot de passe *");
    final PasswordTextBox passwordTextBox = new PasswordTextBox();
    passwordTextBox.setMaxLength(255);
    final Label confirmPasswordLabel = new Label(
        "Confirmation du mot de passe *");
    final PasswordTextBox confirmPasswordTextBox = new PasswordTextBox();
    confirmPasswordTextBox.setMaxLength(255);
    final Label cellLabel = new Label("Numéro de mobile");
    final TextBox cellTextBox = new TextBox();
    cellTextBox.setMaxLength(16);

    final HorizontalPanel buttonPanel = new HorizontalPanel();
    final Button okButton = new Button("OK");
    final Button logInButton = new Button("Connexion");

    // Fill popup contents
    popupContents.add(nameLabel);
    popupContents.add(nameTextBox);
    popupContents.add(mailLabel);
    popupContents.add(mailTextBox);
    popupContents.add(cellLabel);
    popupContents.add(cellTextBox);
    popupContents.add(usernameLabel);
    popupContents.add(usernameTextBox);
    popupContents.add(passwordLabel);
    popupContents.add(passwordTextBox);
    popupContents.add(confirmPasswordLabel);
    popupContents.add(confirmPasswordTextBox);
    buttonPanel.add(okButton);
    buttonPanel.add(logInButton);
    buttonPanel.setSpacing(5);
    popupContents.add(buttonPanel);
    loginSignupPopup.setWidget(popupContents);

    // Popup ok button
    okButton.addClickHandler(new ClickHandler() {

      @Override
      public void onClick(ClickEvent event) {

        // Retrieve field values
        String name = nameTextBox.getText().trim();
        String email = mailTextBox.getText().trim();
        String username = usernameTextBox.getText().trim();
        String password = passwordTextBox.getText().trim();
        String confirmPassword = confirmPasswordTextBox.getText()
            .trim();
        String cell = cellTextBox.getText().trim();

        // Validate field values

        try {
          Validator.validateSignUp(name, email, username, password,
              confirmPassword, cell);

          signUp(name, email, username, confirmPassword, cell);
        } catch (Exception caught) {

          System.err.println(caught.getClass().getName() + " :: "
              + caught.getMessage());
          // caught.printStackTrace();

          if (caught instanceof RequiredFieldException) {

            Window.alert(PdpScanner.REQUIRED_FIELDS_ERROR);
          } else if (caught instanceof BadEmailException) {

            Window.alert(PdpScanner.BAD_EMAIL_ERROR);
          } else if (caught instanceof BadCellException) {

            Window.alert(PdpScanner.BAD_CELL_ERROR);
          } else if (caught instanceof BadPasswordLengthException) {

            Window.alert(PdpScanner.BAD_PASSWORD_LENGTH_ERROR);
          } else if (caught instanceof BadPasswordConfirmationException) {

            Window.alert(PdpScanner.BAD_PASSWORD_CONFIRMATION_ERROR);
          } else {

            Window.alert(PdpScanner.SIGNUP_USER_ERROR);
          }
        }
      }
    });

    // Popup confirm password textbox
    confirmPasswordTextBox.addKeyPressHandler(new KeyPressHandler() {

      @Override
      public void onKeyPress(KeyPressEvent event) {

        if (event.getCharCode() == 13) {
View Full Code Here

          password.setFocus(true);
        }
      }
    });

    password = new PasswordTextBox();
    password.setVisibleLength(25);
    password.addKeyPressHandler(GlobalKey.STOP_PROPAGATION);
    password.addKeyPressHandler(new KeyPressHandler() {
      @Override
      public void onKeyPress(final KeyPressEvent event) {
View Full Code Here

*/
public class PasswordTextBoxWidgetFactory extends
    TextBoxBaseWidgetFactory<PasswordTextBox> {

  protected PasswordTextBox createWidget() {
    return new PasswordTextBox();
  }
View Full Code Here

    private CheckBox checkbox;

    @Inject
    public SignInPageView() {
        userNameField = new TextBox();
        passwordField = new PasswordTextBox();
        signInButton = new Button("Sign in");
        signInButton.setStyleName("default-button");

        userNameField.setText("admin");
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.PasswordTextBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.