Package com.sshtools.ui.awt.options

Examples of com.sshtools.ui.awt.options.OptionDialog


        gbc.weightx = 1.0;
        UIUtil.gridBagAdd(p, password, gbc, GridBagConstraints.REMAINDER);
        password.requestFocus();
        password.setEchoChar('*');

        final OptionDialog dialog = new OptionDialog(OptionDialog.QUESTION, p, OptionDialog.CHOICES_OK_CANCEL, null);
        username.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                dialog.choice(OptionDialog.CHOICE_OK);
            }
        });
        password.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                dialog.choice(OptionDialog.CHOICE_OK);
            }
        });
        if (domain != null) {
            domain.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    dialog.choice(OptionDialog.CHOICE_OK);
                }
            });
        }

        if (dialog.dialogPrompt(null, Messages.getString("AuthenticationDialog.title")) == OptionDialog.CHOICE_OK) { //$NON-NLS-1$
            authenticator.setCredentials(new PasswordCredentials(username.getText().trim(), password.getText()));
            if (authenticator instanceof NTLMAuthentication && !domain.getText().trim().equals("")) { //$NON-NLS-1$
                ((NTLMAuthentication) authenticator).setDomain(domain.getText().trim());
            }
            return true;
View Full Code Here

TOP

Related Classes of com.sshtools.ui.awt.options.OptionDialog

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.