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

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


    /**
     * {@inheritDoc}
     */
    protected Object createComponentInstance(Object parent, DomNode element)
    {
        PasswordTextBox tb = new PasswordTextBox();
        return tb;
    }
View Full Code Here


    TextBox tb = new TextBox();
    tb.setWidth("200px");
    tbs.put(name, new Entry(label, tb));
  }
  private void _addPwTb(String name, String label) {
    TextBox tb = new PasswordTextBox();
    tb.setWidth("200px");
    tbs.put(name, new Entry(label, tb));
  }
View Full Code Here

      // Add some standard form options
      final TextBox userBox = new TextBox();
      userBox.setText("imdev");
      layout.setHTML(0, 0, constants.user());
      layout.setWidget(0, 1, userBox);
      final PasswordTextBox  passBox = new PasswordTextBox ();
      passBox.setText("imdev631");
     
      layout.setHTML(1, 0, constants.password());
      layout.setWidget(1, 1, passBox);

      // Create some advanced options
      Grid advancedOptions = new Grid(5, 2);
      advancedOptions.setCellSpacing(6);
     
      final TextBox hostBox = new TextBox();
      final TextBox portBox = new TextBox();
      final TextBox domainBox = new TextBox();
      final CheckBox authCheck = new CheckBox("SASL");
      authCheck.setChecked(false);
     
      hostBox.setEnabled(false);
    portBox.setEnabled(false);
    domainBox.setEnabled(false);
    authCheck.setEnabled(false);
           
      final CheckBox serverConfig = new CheckBox(constants.defineServerConfig());
      advancedOptions.setWidget(0, 0, serverConfig);
      serverConfig.addClickListener(new ClickListener()
      {
      public void onClick(Widget sender) {
        if(serverConfig.isChecked())
        {
          hostBox.setEnabled(true);
          portBox.setEnabled(true);
          domainBox.setEnabled(true);
          authCheck.setEnabled(true);
        }
        else
        {
          hostBox.setEnabled(false);
          portBox.setEnabled(false);
          domainBox.setEnabled(false);
          authCheck.setEnabled(false);
        }
       
      }
       
      });
     
      serverConfig.setChecked(false);
     
      advancedOptions.setHTML(1, 0, constants.domain());
      advancedOptions.setWidget(1, 1, hostBox);
     
      advancedOptions.setHTML(2, 0, constants.host());
      advancedOptions.setWidget(2, 1, portBox);
     
      advancedOptions.setHTML(3, 0, constants.port());
      advancedOptions.setWidget(3, 1, domainBox);
     
      advancedOptions.setWidget(4, 0, authCheck);

      // Add advanced options to form in a disclosure panel
      DisclosurePanel advancedDisclosure = new DisclosurePanel(
          constants.moreOptions());
      advancedDisclosure.setAnimationEnabled(true);
      advancedDisclosure.ensureDebugId("cwDisclosurePanel");
      advancedDisclosure.setContent(advancedOptions);
      layout.setWidget(2, 0, advancedDisclosure);
     
      Button loginButton = new Button(constants.login());
     
      layout.setWidget(3, 0,loginButton);
      loginButton.addSelectionListener(new SelectionListener<ButtonEvent>()
      {
      public void componentSelected(ButtonEvent ce)
      {
        String user = userBox.getText();
          String pass = passBox.getText();
          String domain = domainBox.getText();
          String host = domainBox.getText();
          boolean sasl = authCheck.isChecked();
          if(serverConfig.isChecked())
          {
View Full Code Here

  }
 
  private void createUsernameAndPasswordTextBoxes() {
    userName = new TextBox();
    userName.setWidth("200");
    userPassword = new PasswordTextBox();
    userPassword.setWidth("200");
   
    UserInfo userInfo = CookieMan.getUserInfo();
    if ( userInfo != null ) {
      userName.setText(userInfo.getUsername());
View Full Code Here

        final Label loginPrompt = new Label(c.Please_log_in());
        // "Please log in; leaving fields empty.");
        final Label namePrompt = new Label(c.Name());
        final TextBox nameTextbox = new TextBox();
        final Label passwordPrompt = new Label(c.Password());
        final PasswordTextBox passwordTextbox = new PasswordTextBox();
        final Button button = new Button(c.Login());

        nameTextbox.setEnabled(false);
        passwordTextbox.setEnabled(false);

        button.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                History.newItem(iCing.WELCOME_STATE);
            }
        });

        loginPrompt.addStyleName("loginPrompt");
        /**
         * nameTextbox.addStyleName("nameField"); passwordTextbox.addStyleName("passwordField");
         */
        grid.setWidget(0, 1, loginPrompt);
        grid.setWidget(1, 0, namePrompt);
        grid.setWidget(1, 1, nameTextbox);
        nameTextbox.setTitle(c.Short_name_like());

        grid.setWidget(2, 0, passwordPrompt);
        grid.setWidget(2, 1, passwordTextbox);
        passwordTextbox.setTitle(c.Short_secret_wo());

        grid.setWidget(3, 1, button);
        button.setTitle(c.Advance_to_file());
    }
View Full Code Here

   */
  public void onModuleLoad() {
    final Button sendButton = new Button("Login");
    final TextBox nameField = new TextBox();
    nameField.setWidth("100px");
    final PasswordTextBox passwordField = new PasswordTextBox();
    passwordField.setWidth("100px");
    final Label errorLabel = new Label();

    // We can add style names to widgets
    sendButton.addStyleName("sendButton");

    // Add the nameField and sendButton to the RootPanel
    // Use RootPanel.get() to get the entire body element
    RootPanel.get("nameFieldContainer").add(nameField);
    RootPanel.get("loginFieldContainer").add(passwordField);
    RootPanel.get("sendButtonContainer").add(sendButton);
    RootPanel.get("errorLabelContainer").add(errorLabel);

    // Focus the cursor on the name field when the app loads
    nameField.setFocus(true);
    nameField.selectAll();

    // Create the popup dialog box
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Remote Procedure Call");
    dialogBox.setAnimationEnabled(true);
    final Button closeButton = new Button("Close");
    // We can set the id of a widget by accessing its Element
    closeButton.getElement().setId("closeButton");
    final Label textToServerLabel = new Label();
    final HTML serverResponseLabel = new HTML();
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.addStyleName("dialogVPanel");
    dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
    dialogVPanel.add(textToServerLabel);
    dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
    dialogVPanel.add(serverResponseLabel);
    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel);

    // Add a handler to close the DialogBox
    closeButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        dialogBox.hide();
        sendButton.setEnabled(true);
        sendButton.setFocus(true);
      }
    });

    // Create a handler for the sendButton and nameField
    class MyHandler implements ClickHandler, KeyUpHandler {
      /**
       * Fired when the user clicks on the sendButton.
       */
      public void onClick(ClickEvent event) {
        sendNameToServer();
      }

      /**
       * Fired when the user types in the nameField.
       */
      public void onKeyUp(KeyUpEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          sendNameToServer();
        }
      }

      /**
       * Send the name from the nameField to the server and wait for a response.
       */
      private void sendNameToServer() {
        // First, we validate the input.
        errorLabel.setText("");
        String username = nameField.getText();
        String password = passwordField.getText();
        if (!FieldVerifier.isValidName(username)) {
          errorLabel.setText("Please enter at least four characters");
          return;
        }
       
View Full Code Here

        setup();
        setRequired(required);
    }

    private void setup(){
        textBox = new PasswordTextBox();
        textBox.setName(name);
        textBox.setTitle(title);
        textBox.setTabIndex(0);

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

    Label nicknameLabel = new Label("Nickname:");
    nicknameLabel.addStyleName("instructions-style");
    final TextBox nicknameTextBox = new TextBox();
    Label passwordLabel = new Label("Password:");
    passwordLabel.addStyleName("instructions-style");
    final PasswordTextBox password = new PasswordTextBox();

    ClickHandler loginHander = new ClickHandler() {

      @Override
      public void onClick(ClickEvent event) {
        String nickname = nicknameTextBox.getText();
        String passwordS = password.getText();

        AsyncCallback<Player> callback = new AsyncCallback<Player>() {

          @Override
          public void onSuccess(Player result) {
View Full Code Here

    FormPanel frmLogin = new FormPanel();
    FlexTable login = new FlexTable();
    Label lblUsername = new Label("Username");
    Label lblPassword = new Label("Password");
    TextBox txtUsername = new TextBox();
    PasswordTextBox txtPassword = new PasswordTextBox();
    Button btnLogin = new Button("Login");
    HTML loginTitle = new HTML();
   
    txtUsername.setWidth("160px");
    txtPassword.setWidth("160px");
   
    loginTitle.setHTML("<h3>Login</h3>");
    loginTitle.setStyleName("loginPanelTitle");
   
    login.setWidget(0,0,lblUsername);
View Full Code Here

    FormPanel frmCreateUser = new FormPanel();
    FlexTable createUser = new FlexTable();
    Label lblUsername = new Label("Username");
    Label lblPassword = new Label("Password");
    TextBox txtUsername = new TextBox();
    PasswordTextBox txtPassword = new PasswordTextBox();
    Button btnCreateUser = new Button("Create User");
    HTML createUserTitle = new HTML();
   
    txtUsername.setWidth("160px");
    txtPassword.setWidth("160px");
   
    createUserTitle.setHTML("<h3>Login</h3>");
    createUserTitle.setStyleName("loginPanelTitle");
   
    createUser.setWidget(0,0,lblUsername);
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.