Example usage for com.google.gwt.user.client.ui PasswordTextBox PasswordTextBox

List of usage examples for com.google.gwt.user.client.ui PasswordTextBox PasswordTextBox

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui PasswordTextBox PasswordTextBox.

Prototype

public PasswordTextBox() 

Source Link

Document

Creates an empty password text box.

Usage

From source file:asquare.gwt.tests.focus.client.Demo.java

License:Apache License

private Widget createFocusPanel() {
    Table outer = new Table();

    outer.add(new FocusPanel(new Label("Label in a FocusPanel")));
    outer.add(new Button("Button"));
    outer.add(new CheckBox("CheckBox"));
    outer.add(new TextBox());
    outer.add(new PasswordTextBox());
    outer.add(new TextArea());
    outer.add(new RadioButton("group1", "RadioButton1"));
    outer.add(new RadioButton("group1", "RadioButton2"));
    ListBox listBox1 = new ListBox();
    listBox1.addItem("ListBox1");
    listBox1.addItem("item2");
    listBox1.addItem("item3");
    outer.add(listBox1);//from  w  w  w.j av a2  s.  co  m
    ListBox listBox2 = new ListBox(true);
    listBox2.setVisibleItemCount(3);
    listBox2.addItem("ListBox2");
    listBox2.addItem("item2");
    listBox2.addItem("item3");
    outer.add(listBox2);
    Tree tree = new Tree();
    tree.addItem("Tree");
    tree.addItem("item2");
    tree.addItem("item3");
    outer.add(tree);

    return outer;
}

From source file:asquare.gwt.tests.focusevent.client.Demo.java

License:Apache License

private Widget createDemoPanel() {
    TestPanel outer = new TestPanel();

    outer.add(new Label("GWT onfocus Event Handler"));
    outer.add(new Button("Button"), "Button");
    outer.add(new CheckBox("CheckBox"), "CheckBox");
    outer.add(new RadioButton("group1", "RadioButton1"), "RadioButton1");
    TextBox textBox = new TextBox();
    textBox.setText("TextBox");
    outer.add(textBox, "TextBox");
    PasswordTextBox passwordTextBox = new PasswordTextBox();
    passwordTextBox.setText("PasswordTextBox");
    outer.add(passwordTextBox, "PasswordTextBox");
    TextArea textArea = new TextArea();
    textArea.setText("TextArea");
    outer.add(textArea, "TextArea");
    ListBox listBox = new ListBox();
    listBox.addItem("ListBox");
    listBox.addItem("item2");
    listBox.addItem("item3");
    outer.add(listBox, "ListBox");
    outer.add(new FocusPanel(new Label("Label in a FocusPanel")), "FocusPanel");
    Tree tree = new Tree();
    tree.addItem("item1");
    tree.addItem("item2");
    tree.addItem("item3");
    outer.add(tree, "Tree");

    return outer;
}

From source file:asquare.gwt.tkdemo.client.demos.DialogPanel.java

License:Apache License

private Widget createModalDialogDemo() {
    BasicPanel panel = new BasicPanel("div", "block");
    panel.setStyleName("example division");
    DomUtil.setStyleAttribute(panel, "whiteSpace", "nowrap");

    panel.add(new HTML("<h4>ModalDialog examples</h4>"));

    class CloseListener implements ClickHandler {
        private final ModalDialog m_dialog;

        public CloseListener(ModalDialog dialog) {
            m_dialog = dialog;/*from   ww  w .  j  av a2 s .  com*/
        }

        public void onClick(ClickEvent event) {
            m_dialog.hide();
        }
    }

    class CloseButton extends Button {
        public CloseButton(ModalDialog dialog) {
            super("Close");
            addClickHandler(new CloseListener(dialog));
        }

        public CloseButton(ModalDialog dialog, String text) {
            super(text);
            addClickHandler(new CloseListener(dialog));
        }
    }

    final Button plainDialog = new Button("Plain");
    plainDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            dialog.setCaption("Caption area", false);
            dialog.add(new Label("Content area"));
            dialog.add(new CloseButton(dialog));
            dialog.show(plainDialog);
        }
    });
    panel.add(plainDialog);

    final Button verboseDialog = new Button("Verbose");
    verboseDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            dialog.setCaption("Verbose dialog", false);
            dialog.add(new Label("Twas brillig, and the slithy toves " + "  Did gyre and gimble in the wabe: "
                    + "All mimsy were the borogoves, " + "  And the mome raths outgrabe "
                    + "Beware the Jabberwock, my son! " + "The jaws that bite, the claws that catch! "
                    + "Beware the Jubjub bird, and shun " + "The frumious Bandersnatch!"));
            dialog.add(new CloseButton(dialog));
            dialog.show(verboseDialog);
        }
    });
    panel.add(verboseDialog);

    final Button captionLessDialog = new Button("No caption");
    captionLessDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            dialog.add(new Label("Captionless dialog"));
            dialog.add(new CloseButton(dialog));
            dialog.show(captionLessDialog);
        }
    });
    panel.add(captionLessDialog);

    final Button loadingDialog = new Button("Loading...");
    loadingDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            final Label label = new Label("0% loaded");
            dialog.add(label);
            dialog.show(loadingDialog);
            new Timer() {
                private int m_count = 0;

                public void run() {
                    label.setText(++m_count + "% loaded");
                    if (m_count == 100) {
                        dialog.hide();
                        cancel();
                    }
                }
            }.scheduleRepeating(1);
        }
    });
    panel.add(loadingDialog);

    final Button undraggableDialog = new Button("Drag disabled");
    undraggableDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog() {
                protected List<Controller> createCaptionControllers() {
                    List<Controller> result = new ArrayList<Controller>();
                    result.add(ControlSurfaceController.getInstance());
                    return result;
                }
            };
            dialog.setCaption("Drag disabled", false);
            dialog.add(new Label(
                    "This dialog uses a custom controller in the header which does not provide drag support."));
            dialog.add(new CloseButton(dialog));
            dialog.show(undraggableDialog);
        }
    });
    panel.add(undraggableDialog);

    final Button styledDragDialog = new Button("Drag style");
    styledDragDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            String oldPrimaryName = dialog.getStylePrimaryName();
            dialog.setStylePrimaryName("dialog-dragstyle");
            dialog.addStyleName(oldPrimaryName);
            dialog.setCaption("Drag me", false);
            dialog.add(new Label(
                    "This dialog employs the \"tk-ModalDialog-dragging\" style which is applied while dragging. "));
            dialog.add(new CloseButton(dialog));
            dialog.show(styledDragDialog);
        }
    });
    panel.add(styledDragDialog);

    final Button focusManagementDialog = new Button("Focus management");
    focusManagementDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            dialog.setCaption("Register", false);
            FocusModel fModel = dialog.getFocusModel();

            final int FIELD_COUNT = 3;
            Grid table = new Grid(FIELD_COUNT, 2);
            dialog.add(table);
            Widget[] labels = new Widget[FIELD_COUNT];
            labels[0] = new Label("User name: ");
            labels[1] = new Label("Password: ");
            labels[2] = new Label("Retype password: ");

            FocusWidget[] fields = new FocusWidget[FIELD_COUNT];
            fields[0] = new TextBox();
            fields[1] = new PasswordTextBox();
            fields[2] = new PasswordTextBox();

            CellFormatter formatter = table.getCellFormatter();
            for (int i = 0; i < labels.length; i++) {
                table.setWidget(i, 0, labels[i]);
                formatter.setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_LEFT);
                table.setWidget(i, 1, fields[i]);

                /*
                 * Manually add fields to focus cycle. (The dialog does not
                 * scan the children of panels for focusable widgets.)
                 */
                fModel.add(fields[i]);
            }

            // this widget will be focused when the dialog is shown
            fModel.setFocusWidget(fields[0]);

            ColumnPanel buttonPanel = new ColumnPanel();
            buttonPanel.setWidth("100%");
            dialog.add(buttonPanel);

            Button closeButton = new CloseButton(dialog, "Register!");
            fModel.add(closeButton);
            buttonPanel.add(closeButton);

            Button cancelButton = new CloseButton(dialog, "Cancel");
            fModel.add(cancelButton);
            buttonPanel.addWidget(cancelButton, false);
            buttonPanel.setCellHorizontalAlignment(ColumnPanel.ALIGN_RIGHT);

            dialog.show(focusManagementDialog);
        }
    });
    panel.add(focusManagementDialog);

    final Button explicitlyPositionedDialog = new Button("Explicitly positioned");
    explicitlyPositionedDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            dialog.removeController(dialog.getController(ModalDialog.PositionDialogController.class));
            int contentWidth = 300;
            int contentHeight = 100;
            dialog.setContentWidth(contentWidth + "px");
            dialog.setContentHeight(contentHeight + "px");
            dialog.setPopupPosition(100, 100);
            dialog.setCaption("Explicitly positioned dialog", false);
            dialog.add(new Label(
                    "Automatic positioning is disabled. Dimensions and position are set explicitly. "));
            dialog.add(new CloseButton(dialog));
            dialog.show(explicitlyPositionedDialog);
        }
    });
    panel.add(explicitlyPositionedDialog);

    final Button multipleDialogs = new Button("Multiple dialogs");
    multipleDialogs.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            ModalDialog dialog = new ModalDialog();
            dialog.setCaption("First dialog", false);
            FocusModel fModel = dialog.getFocusModel();
            RowPanel outer = new RowPanel();

            dialog.add(new HTML(""));

            final UrlLocation urlBox = new UrlLocation();
            urlBox.setText("http://www.asquare.net");
            urlBox.setWidth("350px");
            fModel.add(urlBox);
            outer.add(urlBox);

            Button goButton = new Button("Go");
            fModel.add(goButton);
            fModel.setFocusWidget(goButton);
            outer.addWidget(goButton, false);

            ListBox addressList = new ListBox();
            addressList.addItem("Select an address");
            addressList.addItem("http://www.asquare.net");
            addressList.addItem("http://www.google.com");
            addressList.addItem("http://www.sourceforge.net");
            addressList.addItem("http://www.apache.org");
            fModel.add(addressList);
            outer.add(addressList);

            final Frame frame = new Frame();
            frame.setSize("400px", "200px");
            outer.add(frame);
            urlBox.addChangeHandler(new ChangeHandler() {
                public void onChange(ChangeEvent event) {
                    frame.setUrl(urlBox.getURL());
                }
            });
            goButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    frame.setUrl(urlBox.getURL());
                }
            });
            addressList.addChangeHandler(new ChangeHandler() {
                public void onChange(ChangeEvent event) {
                    ListBox list = (ListBox) event.getSource();
                    if (list.getSelectedIndex() > 0) {
                        urlBox.setText(list.getItemText(list.getSelectedIndex()));
                        frame.setUrl(list.getItemText(list.getSelectedIndex()));
                    }
                }
            });
            final Button secondDialog = new Button("Show second dialog");
            secondDialog.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    final ModalDialog dialog = new ModalDialog();
                    dialog.setCaption("Second dialog", false);
                    dialog.add(new Label("Note that you cannot manipulate the widgets in the first dialog. "));
                    dialog.add(new CloseButton(dialog));
                    dialog.show(secondDialog);
                }
            });
            fModel.add(secondDialog);
            outer.add(secondDialog);
            Button closeButton = new CloseButton(dialog);
            fModel.add(closeButton);
            outer.add(closeButton);
            dialog.add(outer);
            dialog.show(multipleDialogs);
        }
    });
    panel.add(multipleDialogs);

    final Button styledDialog = new Button("Styled");
    styledDialog.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final ModalDialog dialog = new ModalDialog();
            dialog.addStyleName("dialog-styled");
            HorizontalPanel caption = new HorizontalPanel();
            caption.setWidth("100%");
            Label captionText = new Label("Oopsie!");
            caption.add(captionText);
            caption.setCellWidth(captionText, "100%");
            Image close = new Image("close.gif");
            close.addClickHandler(new CloseListener(dialog));
            caption.add(close);
            dialog.setCaption(caption);
            dialog.add(new Label("I've been a bad, bad browser."));
            dialog.add(new Button("Deny ice cream", new CloseListener(dialog)));
            dialog.show(styledDialog);
        }
    });
    panel.add(styledDialog);

    return panel;
}

From source file:asquare.gwt.tkdemo.client.demos.EventsPanel.java

License:Apache License

private static Collection<Widget> createSomeWidgets() {
    ArrayList<Widget> result = new ArrayList<Widget>();
    result.add(new HTML("<b>Double-click a widget to select it</b>"));
    result.add(new Button("Button"));
    result.add(new CheckBox("CheckBox"));
    result.add(new RadioButton("group", "RadioButton"));
    result.add(new SimpleHyperLink("SimpleHyperLink"));
    TextBox tb = new TextBox();
    tb.setText("TextBox");
    result.add(tb);//w  w w. java 2s .co m
    PasswordTextBox ptb = new PasswordTextBox();
    ptb.setText("PasswordTextBox");
    result.add(ptb);
    return result;
}

From source file:asquare.gwt.tkdemo.client.demos.FocusCycleDemo.java

License:Apache License

private Widget createFocusCycle1() {
    FocusCyclePanel cycle1 = new FocusCyclePanel("div", "block");

    cycle1.add(new Label("Cycle 1"));

    cycle1.add(new FocusStyleDecorator(new Button("Button")));

    Button buttonDisabled = new Button("disabled");
    buttonDisabled.setEnabled(false);/* w ww. j  a va  2s. c  o  m*/
    cycle1.add(new FocusStyleDecorator(buttonDisabled));

    Button buttonNegativeTabIndex = new Button("tabIndex = -1");
    buttonNegativeTabIndex.setTabIndex(-1);
    cycle1.add(new FocusStyleDecorator(buttonNegativeTabIndex));

    cycle1.add(new FocusStyleDecorator(new CheckBox("CheckBox")));

    cycle1.add(new FocusStyleDecorator(new FocusPanel(new Label("FocusPanel"))));

    ListBox listBox = new ListBox();
    listBox.addItem("ListBox");
    listBox.addItem("Item 1");
    listBox.addItem("Item 2");
    listBox.addItem("Item 3");
    cycle1.add(new FocusStyleDecorator(listBox));

    TextBox textBox = new TextBox();
    textBox.setText("TextBox");
    cycle1.add(new FocusStyleDecorator(textBox));

    PasswordTextBox pwBox = new PasswordTextBox();
    pwBox.setText("PasswordTextBox");
    cycle1.add(new FocusStyleDecorator(pwBox));

    TextArea textArea = new TextArea();
    textArea.setText("TextArea");
    cycle1.add(new FocusStyleDecorator(textArea));

    Tree tree = new Tree();
    TreeItem treeRoot = new TreeItem("Tree");
    for (int branchNum = 1; branchNum < 4; branchNum++) {
        TreeItem branch = new TreeItem("Branch " + branchNum);
        for (int item = 1; item < 4; item++) {
            branch.addItem("Item " + item);
        }
        treeRoot.addItem(branch);
    }
    tree.addItem(treeRoot);
    cycle1.add(new FocusStyleDecorator(tree));

    new WidgetFocusStyleController(cycle1.getFocusModel());

    return cycle1;
}

From source file:bingo.client.Bingo.java

License:Open Source License

/**
 * This is the entry point method./*w ww.ja v  a  2 s .com*/
 */
public void onModuleLoad() {
    Label titleLabel = new Label();
    titleLabel.setText(strings.title());
    RootPanel.get("title").add(titleLabel);

    // This is the general notification text box
    RootPanel.get("message").add(message);

    // Cheking if the user has already an user id
    final String cookie = Cookies.getCookie(COOKIE_ID);

    // Validating the cookie
    bingoService.statusUserId(cookie, new AsyncCallback<Integer>() {
        @Override
        public void onFailure(Throwable caught) {
            message.setText(caught.getMessage());
            Cookies.removeCookie(COOKIE_ID);
        }

        @Override
        public void onSuccess(Integer status) {
            // TODO: Control the logged status (I should not get a user if s/he is already logged)
            if (status.intValue() == BingoService.NO_LOGGED || status.intValue() == BingoService.LOGGED) {
                bingoService.getUserId(new AsyncCallback<String>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        message.setText(strings.errorUserCreation());
                    }

                    @Override
                    public void onSuccess(String result) {
                        userId = result;
                    }
                });

                message.setHTML("");

                // Showing image to enter
                ImageResource imageResource = BingoResources.INSTANCE.entry();
                Image entryImage = new Image(imageResource.getSafeUri());
                RootPanel.get("buttons").add(entryImage);

                // Selecting behavior (admin / voter) 
                HorizontalPanel entryPoint = new HorizontalPanel();

                entryPoint.setStyleName("mainSelectorPanel");
                entryPoint.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
                entryPoint.setSpacing(50);

                // 
                // CREATING A BINGO
                //
                VerticalPanel leftPanel = new VerticalPanel();
                leftPanel.setStyleName("selectorPanel");

                Label leftPanelTitle = new Label();
                leftPanelTitle.setStyleName("selectorPanelTitle");
                leftPanelTitle.setText(strings.leftPanelTitle());
                leftPanel.add(leftPanelTitle);
                leftPanel.setCellHorizontalAlignment(leftPanelTitle, HasHorizontalAlignment.ALIGN_CENTER);

                Grid leftSubPanel = new Grid(2, 2);
                leftSubPanel.setWidget(0, 0, new Label(strings.createBingoName()));
                final TextBox bingoNameBox = new TextBox();
                leftSubPanel.setWidget(0, 1, bingoNameBox);

                leftSubPanel.setWidget(1, 0, new Label(strings.createBingoPassword()));
                final PasswordTextBox bingoPasswordBox = new PasswordTextBox();
                leftSubPanel.setWidget(1, 1, bingoPasswordBox);
                leftPanel.add(leftSubPanel);

                final Button createButton = new Button("Create");
                createButton.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        bingoService.createBingo(userId, bingoNameBox.getText(), bingoPasswordBox.getText(),
                                new AsyncCallback<String>() {
                                    @Override
                                    public void onFailure(Throwable caught) {
                                        message.setText(caught.getMessage());
                                    }

                                    @Override
                                    public void onSuccess(final String gameId) {
                                        final BingoGrid bingoGrid = new BingoGrid();
                                        initAdminGrid(userId, bingoGrid, false);
                                        RootPanel.get("bingoTable").clear();
                                        RootPanel.get("bingoTable").add(bingoGrid);
                                        message.setText(strings.welcomeMessageCreation());

                                        // Setting the cookie
                                        Date expirationDate = new Date();
                                        expirationDate.setHours(expirationDate.getHours() + EXPIRATION_VALUE);
                                        Cookies.setCookie(COOKIE_ID, userId, expirationDate);
                                    }
                                });
                    }
                });
                leftPanel.add(createButton);
                leftPanel.setCellHorizontalAlignment(createButton, HasHorizontalAlignment.ALIGN_CENTER);
                entryPoint.add(leftPanel);

                // 
                // JOINING
                //
                VerticalPanel rightPanel = new VerticalPanel();
                rightPanel.setStyleName("selectorPanel");

                Label rightPanelTitle = new Label();
                rightPanelTitle.setStyleName("selectorPanelTitle");
                rightPanelTitle.setText(strings.rightPanelTitle());
                rightPanel.add(rightPanelTitle);
                rightPanel.setCellHorizontalAlignment(rightPanelTitle, HasHorizontalAlignment.ALIGN_CENTER);

                Grid rightSubPanel = new Grid(2, 2);
                rightSubPanel.setWidget(0, 0, new Label(strings.joinToBingoName()));
                final ListBox joinExistingBingoBox = new ListBox();
                bingoService.getBingos(new AsyncCallback<String[][]>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        joinExistingBingoBox.addItem(strings.noBingos());
                    }

                    @Override
                    public void onSuccess(String[][] result) {
                        if (result == null) {
                            joinExistingBingoBox.addItem(strings.noBingos());
                        } else {
                            for (int i = 0; i < result.length; i++) {
                                String gameName = result[i][0];
                                String gameId = result[i][1];
                                joinExistingBingoBox.addItem(gameName, gameId);
                            }
                        }
                    }
                });
                rightSubPanel.setWidget(0, 1, joinExistingBingoBox);

                rightSubPanel.setWidget(1, 0, new Label(strings.joinToBingoPassword()));
                final PasswordTextBox joinBingoPasswordBox = new PasswordTextBox();
                rightSubPanel.setWidget(1, 1, joinBingoPasswordBox);
                rightPanel.add(rightSubPanel);

                final Button joinButton = new Button("Join");
                joinButton.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        int index = joinExistingBingoBox.getSelectedIndex();
                        if (index < 0)
                            message.setText(strings.noSelectedItem());
                        else {
                            final String gameId = joinExistingBingoBox.getValue(index);
                            if (gameId == null)
                                message.setText(strings.noSelectedItem());
                            else {
                                bingoService.joinBingo(userId, gameId, joinBingoPasswordBox.getText(),
                                        new AsyncCallback<Void>() {
                                            @Override
                                            public void onFailure(Throwable caught) {
                                                message.setText(caught.getMessage());
                                            }

                                            @Override
                                            public void onSuccess(Void result) {
                                                final BingoGrid bingoGrid = new BingoGrid();
                                                initUserGrid(bingoGrid);
                                                RootPanel.get("bingoTable").clear();
                                                RootPanel.get("bingoTable").add(bingoGrid);

                                                message.setText(strings.welcomeMessageJoin());

                                                // Setting the cookie
                                                Date expirationDate = new Date();
                                                expirationDate
                                                        .setHours(expirationDate.getHours() + EXPIRATION_VALUE);
                                                Cookies.setCookie(COOKIE_ID, userId, expirationDate);
                                            }
                                        });
                            }
                        }
                    }
                });
                rightPanel.add(joinButton);
                rightPanel.setCellHorizontalAlignment(joinButton, HasHorizontalAlignment.ALIGN_CENTER);
                entryPoint.add(rightPanel);

                RootPanel.get("bingoTable").add(entryPoint);

            } else if (status.intValue() == BingoService.ADMIN) {
                message.setText("Detected cookie: " + cookie + " as admin");
                userId = cookie;

                bingoService.statusBingo(userId, new AsyncCallback<Integer>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        message.setText(caught.getMessage());
                    }

                    @Override
                    public void onSuccess(Integer result) {
                        int status = result.intValue();
                        final BingoGrid bingoGrid = new BingoGrid();
                        if (status == BingoService.RUNNING) {
                            initAdminGrid(userId, bingoGrid, false);
                            message.setText(strings.welcomeMessageCreation());
                        } else if (status == BingoService.FINISHED) {
                            initAdminGrid(userId, bingoGrid, true);
                            message.setText(strings.finishMessage());
                        }
                        RootPanel.get("bingoTable").clear();
                        RootPanel.get("bingoTable").add(bingoGrid);
                    }
                });

            } else if (status.intValue() == BingoService.PARTICIPANT) {
                message.setText("Detected cookie: " + cookie + " as participant");
                userId = cookie;

                final BingoGrid bingoGrid = new BingoGrid();
                initUserGrid(bingoGrid);
                updateUserGrid(bingoGrid, null);
                RootPanel.get("bingoTable").clear();
                RootPanel.get("bingoTable").add(bingoGrid);
            }
        }
    });
}

From source file:burrito.client.widgets.inputfield.PasswordInputField.java

License:Apache License

@Override
protected TextBox createField() {
    return new PasswordTextBox();
}

From source file:bwbv.rlt.client.ui.HeaderPane.java

License:Apache License

private void showNewUserNameRequestPopupPanel() {
    confirmPopup = new PopupPanel(false, true);
    VerticalPanel panel = new VerticalPanel();
    //      panel.add(new Label("What is your login Name?"));
    //      panel.add(textBox);
    Grid grid = new Grid(2, 2);
    grid.setText(0, 0, "Benutzer:");
    final TextBox textBox = new TextBox();
    grid.setWidget(0, 1, textBox);/*from w w  w  .  j  av  a  2s. c  o m*/
    grid.setText(1, 0, "Passwort:");
    final PasswordTextBox pwdBox = new PasswordTextBox();
    grid.setWidget(1, 1, pwdBox);
    panel.add(grid);
    Button ok = new Button("OK");
    ok.addClickListener(new ClickListener() {
        public void onClick(Widget w) {
            confirmPopup.hide();
            login(textBox.getText(), pwdBox.getText());
        }
    });

    panel.add(ok);
    confirmPopup.add(panel);
    confirmPopup.center();
    textBox.setFocus(true);
    confirmPopup.show();
}

From source file:ca.ubc.ece.netsyslab.tagvalue.client.AuthenticationWidget.java

License:Open Source License

/**
 * Instantiates a new authorization widget.
 *
 * @param service a proxy to the backend service that guides the user.
 *//* w ww. j  av a  2s  .com*/
public AuthenticationWidget() {
    username = "";
    password = "";
    usernameBox = new TextBox();
    usernameBox.setText("username");
    usernameBox.setTitle("Type your del.icio.us username in the box");
    usernameBox.setFocus(true);
    usernameBox.selectAll();
    usernameBox.addClickHandler(this);
    usernameBox.addKeyUpHandler(this);

    passwordBox = new PasswordTextBox();
    passwordBox.setText("password");
    passwordBox.setTitle("Type your del.icio.us password");
    passwordBox.addClickHandler(this);
    passwordBox.addKeyUpHandler(this);

    startButton = new Button();
    startButton.setText("Start");
    startButton.setTitle("Click here to give consent and start the experiment");
    startButton.addStyleName("sendButton");
    startButton.addClickHandler(this);

    setWidget(0, 0, usernameBox);
    setWidget(0, 1, passwordBox);
    setWidget(0, 2, startButton);
}

From source file:cc.alcina.framework.gwt.client.widget.dialog.LoginDisplayer.java

License:Apache License

public LoginDisplayer() {
    dialogBox = new GlassDialogBox();
    dialogBox.setText("Login");
    dialogBox.setAnimationEnabled(true);
    mainPanel = new FlowPanel();
    mainPanel.setStyleName("alcina-Login");
    mainPanel.ensureDebugId(AlcinaDebugIds.LOGIN_FORM);
    this.introWidget = new FlowPanel();
    introWidget.setVisible(false);/*from  w w  w.j  av  a  2  s  .c  om*/
    mainPanel.add(introWidget);
    introWidget.setStyleName("intro");
    cancelButton = new Button("Cancel");
    okButton = new Button("Login");
    okButton.ensureDebugId(AlcinaDebugIds.LOGIN_SUBMIT);
    table = new FlexTable();
    table.setWidth("100%");
    table.setCellSpacing(2);
    this.usernameLabel = new Label("Username: ");
    table.setWidget(0, 0, usernameLabel);
    nameBox = new TextBox();
    WidgetUtils.disableTextBoxHelpers(nameBox);
    nameBox.ensureDebugId(AlcinaDebugIds.LOGIN_USERNAME);
    table.setWidget(0, 1, nameBox);
    table.setWidget(1, 0, new Label("Password: "));
    pwdBox = new PasswordTextBox();
    WidgetUtils.disableTextBoxHelpers(pwdBox);
    pwdBox.ensureDebugId(AlcinaDebugIds.LOGIN_PASSWORD);
    table.setWidget(1, 1, pwdBox);
    pwdBox.addKeyPressHandler(new EnterAsClickKeyboardListener(pwdBox, okButton));
    nameBox.addKeyPressHandler(new EnterAsClickKeyboardListener(nameBox, okButton));
    rememberMeBox = new CheckBox();
    rememberMeBox.setValue(true);
    table.setWidget(2, 0, rememberMeBox);
    table.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    table.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    table.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    table.setWidget(2, 1, new Label("Remember me on this computer"));
    statusLabel = new Label("Logging in");
    statusLabel.setVisible(false);
    table.setWidget(4, 1, statusLabel);
    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    hPanel.setSpacing(5);
    hPanel.add(okButton);
    okButton.addStyleName("marginRight10");
    hPanel.add(cancelButton);
    table.setWidget(3, 1, hPanel);
    mainPanel.add(table);
    dialogBox.setWidget(mainPanel);
}