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

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


    vpanel.add(new HTML(constants.cwBasicTextNormalLabel()));
    vpanel.add(createTextExample(normalText, true));
    vpanel.add(createTextExample(disabledText, false));

    // Add a normal and disabled password text box
    PasswordTextBox normalPassword = new PasswordTextBox();
    normalPassword.ensureDebugId("cwBasicText-password");
    PasswordTextBox disabledPassword = new PasswordTextBox();
    disabledPassword.ensureDebugId("cwBasicText-password-disabled");
    disabledPassword.setText(constants.cwBasicTextReadOnly());
    disabledPassword.setEnabled(false);
    vpanel.add(new HTML("<br><br>" + constants.cwBasicTextPasswordLabel()));
    vpanel.add(createTextExample(normalPassword, true));
    vpanel.add(createTextExample(disabledPassword, false));

    // Add a text area
View Full Code Here


                                                       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);

        textBox.addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override
View Full Code Here

            }
        });
        userNameField.setVisibleLength(VISIBLE_LENGTH);

        addVerticalSpacer();
        passwordField = new PasswordTextBox();
        addWidget("Password", passwordField);
        confirmPasswordField = new PasswordTextBox();
        addWidget("Confirm Password", confirmPasswordField);

        addVerticalSpacer();
        verificationWidget = new NullHumanVerificationWidget();
//        verificationWidget = new RecaptchaWidget();
View Full Code Here

public class EditAccountPanel extends FlexTable {

  public EditAccountPanel(final IGenericCallback<User> callback, final User user) {

    final TextBox usernameTextBox = new TextBox();
    final PasswordTextBox passwordTextBox = new PasswordTextBox();
    final TextBox passwordHintTextBox = new TextBox();
    final TextBox firstnameTextBox = new TextBox();
    final TextBox lastnameTextBox = new TextBox();
    final TextBox emailTextBox = new TextBox();
    Date birthday = new Date(user.getBirthday());
    DefaultFormat format = new DefaultFormat(DateTimeFormat.getMediumDateFormat());
    final DateBox birthdayPicker = new DateBox(new MyDatePicker(), birthday, format);
    final CheckBox validatedCheckBox = new CheckBox("Validated");
    final CheckBox administratorCheckBox = new CheckBox("Administrator");

    usernameTextBox.setText(user.getUsername());
    passwordHintTextBox.setText(user.getPasswordHint());
    firstnameTextBox.setText(user.getFirstname());
    lastnameTextBox.setText(user.getLastname());
    emailTextBox.setText(user.getEmail());
    validatedCheckBox.setValue(user.isValidated());
    administratorCheckBox.setValue(user.isAdministrator());
    birthdayPicker.setValue(birthday);

    Button applyButton = new Button("Apply");
    applyButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        user.setUsername(usernameTextBox.getText());
        user.setPasswordHint(passwordHintTextBox.getText());
        user.setFirstname(firstnameTextBox.getText());
        user.setLastname(lastnameTextBox.getText());
        user.setEmail(emailTextBox.getText());
        user.setBirthday(birthdayPicker.getValue().getTime());
        user.setAdministrator(administratorCheckBox.getValue());
        user.setValidated(validatedCheckBox.getValue());
        final AsyncCallback<User> loginCallback = new AsyncCallback<User>() {
          public void onFailure(Throwable caught) {
            MessageDialogBox dialog = new MessageDialogBox("Error", "Could not edit account.", true, true, true);
            dialog.center();
          }

          public void onSuccess(User user) {
            if (user == null) {
              MessageDialogBox dialog = new MessageDialogBox("Error", "Could not edit account.", true, true, true);
              dialog.center();
            } else {
              MessageDialogBox dialog = new MessageDialogBox("Success", "Account modified.", true, true, true);
              dialog.center();
              callback.invoke(user);
            }
          };
        };

        BaseServiceCache.getService().createOrEditAccount(user, passwordTextBox.getText(), null, loginCallback);
      }
    });
    applyButton.setTitle("Apply Changes");

    // build ui
View Full Code Here

  @Override
  public void onModuleLoad() {
   
    final TextBox usuario = new TextBox();
    final PasswordTextBox password= new PasswordTextBox();
    final Button send  =new Button("Enviar");
   
    RootPanel.get("usuario").add(usuario);
    RootPanel.get("password").add(password);
    RootPanel.get("boton").add(send);
    IUsuarioAsync serverUsuario = GWT.create(IUsuario.class);
    serverUsuario.limpiarSession(new AsyncCallback<Void>() {
     
      @Override
      public void onSuccess(Void result) {
       
      }
     
      @Override
      public void onFailure(Throwable caught) {
        caught.printStackTrace();
        Window.alert("ERROR AJAX");
      }
    });
    send.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        final IUsuarioAsync serverUsuario = GWT.create(IUsuario.class);
       
        serverUsuario.login(usuario.getText(), password.getText(), new AsyncCallback<Boolean>() {
         
          @Override
          public void onSuccess(Boolean result) {
            if(result){
              setWindowHref("../Inicial.html");              
View Full Code Here

public class PasswordTextBoxTest extends GwtTestTest {

   @Test
   public void name() {
      // Arrange
      PasswordTextBox ptb = new PasswordTextBox();
      // Pre-Assert
      assertEquals("", ptb.getName());

      // Act
      ptb.setName("name");

      // Assert
      assertEquals("name", ptb.getName());
   }
View Full Code Here

   }

   @Test
   public void text() {
      // Arrange
      PasswordTextBox ptb = new PasswordTextBox();
      // Pre-Assert
      assertEquals("", ptb.getText());

      // Act
      ptb.setText("text");

      // Assert
      assertEquals("text", ptb.getText());
   }
View Full Code Here

   }

   @Test
   public void title() {
      // Arrange
      PasswordTextBox ptb = new PasswordTextBox();
      // Pre-Assert
      assertEquals("", ptb.getTitle());

      // Act
      ptb.setTitle("title");

      // Assert
      assertEquals("title", ptb.getTitle());
   }
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.