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

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


    final HTML responseField = new HTML();
   
      final FlexCellFormatter cellFormatter = flexTable.getFlexCellFormatter();

    final TextBox usernameField = new TextBox();
    final PasswordTextBox passwordField = new PasswordTextBox();
    final Button loginButton = new Button("Login");
    final ScrollPanel scrollPanel = new ScrollPanel();

    submitButton.addStyleName("sendButton");
    submitButton.setEnabled(false);
    monitorButton.setEnabled(true);   
    goHomeButton.setEnabled(true);
   
    idField.setWidth("400px");
    responseField.setWidth("640px");
    responseField.setVisible(false);

    scrollPanel.add(flexTable);
    scrollPanel.setSize("800px", "600px");
    scrollPanel.addStyleName("cw-ScollPanel");
   
      flexTable.addStyleName("cw-FlexTable");
      flexTable.setCellSpacing(2);
      flexTable.setCellPadding(3);
   
    // Add the fields to the RootPanel
    if (RootPanel.get("nameFieldContainer") != null) {
      //main page
      RootPanel.get("nameFieldContainer").add(fileField);
      RootPanel.get("idFieldContainer").add(idField);
      RootPanel.get("sendButtonContainer").add(submitButton);
      RootPanel.get("responseContainer").add(responseField);
      RootPanel.get("monitorButtonContainer").add(monitorButton);
    }
    else if (RootPanel.get("usernameFieldContainer") != null) {
      //login page
      RootPanel.get("usernameFieldContainer").add(usernameField);
      RootPanel.get("passwordFieldContainer").add(passwordField);
      RootPanel.get("loginButtonContainer").add(loginButton);
    }
    else {
      //results page
      RootPanel.get("homeButtonContainer").add(goHomeButton);     
      RootPanel.get("tableContainer").add(scrollPanel);
        cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
        //cellFormatter.setColSpan(0, 0, 0); 
        //we no longer use timer scheduling, just run it once
        timer.run();     
      // Program a Timer to execute this every N seconds
        //no more auto-refresh: user will refresh manually
        //timer.scheduleRepeating(UPDATE_INTERVAL*1000);
    }
    // Create a handler for the loginButtonButton
    class LoginButtonHandler implements ClickHandler {
      public void onClick(ClickEvent event) {
        String username = usernameField.getText();
        String password = passwordField.getText();
        RootPanel.get().clear();
        Window.Location.assign("/sampleapp?username=" + username + "&password=" + password);
      }     
    }   
    loginButton.addClickHandler(new LoginButtonHandler());
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

                                                       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

import com.google.gwt.user.client.ui.Widget;
import org.jboss.errai.workspaces.client.rpc.Attachable;

public class PasswordBoxAttach implements Attachable {
    public void attach(final String id, final Widget widget, final String instanceId) {
        final PasswordTextBox w = (PasswordTextBox) widget;

//        w.addChangeListener(
//                new ChangeListener() {
//                    public void onChange(Widget widget) {
//                        packet.setParameter(id, w.getText());
View Full Code Here

                    form.submit();
                }
            }
        };

        final PasswordTextBox password = new PasswordTextBox();
        password.setName("j_password");
        password.addKeyboardListener(enterListener);

        username.setText("test");
        password.setText("testaroo");

        HorizontalPanel userP = new HorizontalPanel();

        userP.add(new Label("Username"));
        userP.add(username);
View Full Code Here

    initWidget(uiBinder.createAndBindUi(this));

    table.setWidget(0, 0, new Label(constants.userName()));
    table.setWidget(0, 1, login = new TextBox());
    table.setWidget(1, 0, new Label(constants.password()));
    table.setWidget(1, 1, password = new PasswordTextBox());
    table.setWidget(2, 0, new Label(constants.language()));
    table.setWidget(2, 1, languageBox = createLanguageBox());
    table.setWidget(3, 0, loginBtn = new Button(constants.login()));
    table.setWidget(4, 0, status = new Label());
    table.getFlexCellFormatter().setColSpan(3, 0, 2);
View Full Code Here

* @author Uri Boness
*/
public class PasswordEditor extends AbstractFocusWidgetEditor<String, PasswordTextBox> {

    public PasswordEditor() {
        this(new PasswordTextBox());
    }
View Full Code Here

    public PasswordEditor(boolean enabled) {
        this("", enabled);
    }

    public PasswordEditor(String defaultText, boolean enabled) {
        this(new PasswordTextBox(), defaultText, enabled);
    }
View Full Code Here

      assertEquals(textArea, editor.getTextBox());
    }

    // Use a password field
    {
      PasswordTextBox passBox = new PasswordTextBox();
      TextCellEditor editor = new TextCellEditor(passBox);
      assertEquals(passBox, editor.getTextBox());
    }
  }
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.