/** * Construct modal dialog for display over another Dialog. * * @param owner Dialog over which this dialog will be displayed and centred. * @param title the dialog's title text * @param question the question/statement to prompt the user for their password * @param isNtAuthentication if true a domain name is required in addition to the username and password. */ public AuthenticationDialog(Dialog owner, String title, String question, boolean isNtAuthentication) { super(owner, title, true); this.isNtAuthentication = isNtAuthentication; initGui(question); }
AuthenticationDialog pwDialog = new AuthenticationDialog( ownerFrame, "Authentication Required", "<html>Host <b>" + scope.getHost() + ":" + scope.getPort() + "</b> requires Windows authentication</html>", true); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new NTCredentials( pwDialog.getUser(), pwDialog.getPassword(), scope.getHost(), pwDialog.getDomain()); pwDialog.dispose(); } else if (scope.getScheme().equals("basic") || scope.getScheme().equals("digest")) { AuthenticationDialog pwDialog = new AuthenticationDialog(ownerFrame, "Authentication Required", "<html><center>Host <b>" + scope.getRealm() + "</b></center></html>", false); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new UsernamePasswordCredentials(pwDialog.getUser(), pwDialog.getPassword()); pwDialog.dispose(); } else { throw new IllegalArgumentException("Unsupported authentication scheme: "
this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = 3717631976908670386L; this.getContentPane().add(container); this.pack(); this.setLocationRelativeTo(this.getOwner());
AuthenticationDialog pwDialog = new AuthenticationDialog( ownerFrame, "Authentication Required", "<html>Host <b>" + scope.getHost() + ":" + scope.getPort() + "</b> requires Windows authentication</html>", true); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new NTCredentials( pwDialog.getUser(), pwDialog.getPassword(), scope.getHost(), pwDialog.getDomain()); pwDialog.dispose(); } else if (scope.getScheme().equals("basic") || scope.getScheme().equals("digest")) { AuthenticationDialog pwDialog = new AuthenticationDialog( ownerFrame, "Authentication Required", "<html><center>Host <b>" + scope.getHost() + ":" + scope.getPort() + "</b>" + " requires authentication for the realm:<br><b>" + scope.getRealm() + "</b></center></html>", false); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new UsernamePasswordCredentials(pwDialog.getUser(), pwDialog.getPassword()); pwDialog.dispose(); } else { throw new InvalidCredentialsException(
this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = 3717631976908670386L; this.getContentPane().add(container); this.pack(); this.setLocationRelativeTo(this.getOwner());
AuthenticationDialog pwDialog = new AuthenticationDialog( ownerFrame, "Authentication Required", "<html>Host <b>" + scope.getHost() + ":" + scope.getPort() + "</b> requires Windows authentication</html>", true); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new NTCredentials( pwDialog.getUser(), pwDialog.getPassword(), scope.getHost(), pwDialog.getDomain()); pwDialog.dispose(); } else if (scope.getScheme().equals("basic") || scope.getScheme().equals("digest")) { AuthenticationDialog pwDialog = new AuthenticationDialog(ownerFrame, "Authentication Required", "<html><center>Host <b>" + scope.getRealm() + "</b></center></html>", false); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new UsernamePasswordCredentials(pwDialog.getUser(), pwDialog.getPassword()); pwDialog.dispose(); } else { throw new IllegalArgumentException("Unsupported authentication scheme: "
/** * Construct modal dialog for display over a Frame. * * @param owner Frame over which this dialog will be displayed and centred. * @param title the dialog's title text * @param question the question/statement to prompt the user for their password, may be html * compatible with {@link JHtmlLabel} * @param isNtAuthentication if true a domain name is required in addition to the username and password. */ public AuthenticationDialog(Frame owner, String title, String question, boolean isNtAuthentication) { super(owner, title, true); this.isNtAuthentication = isNtAuthentication; initGui(question); }
AuthenticationDialog pwDialog = new AuthenticationDialog(ownerFrame, "Authentication Required", "<html>Host <b>" + scope.getHost() + ":" + "</b> requires Windows authentication</html>", true); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new NTCredentials( pwDialog.getUser(), pwDialog.getPassword(), scope.getHost(), pwDialog.getDomain()); pwDialog.dispose(); } else if (scope.getScheme().equals("basic") || scope.getScheme().equals("digest")) { AuthenticationDialog pwDialog = new AuthenticationDialog(ownerFrame, "Authentication Required", "<html><center>Host <b>" + scope.getRealm() + "</b></center></html>", false); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new UsernamePasswordCredentials(pwDialog.getUser(), pwDialog.getPassword());
/** * Construct modal dialog for display over a Frame. * * @param owner Frame over which this dialog will be displayed and centred. * @param title the dialog's title text * @param question the question/statement to prompt the user for their password, may be html * compatible with {@link JHtmlLabel} * @param isNtAuthentication if true a domain name is required in addition to the username and password. */ public AuthenticationDialog(Frame owner, String title, String question, boolean isNtAuthentication) { super(owner, title, true); this.isNtAuthentication = isNtAuthentication; initGui(question); }
AuthenticationDialog pwDialog = new AuthenticationDialog( ownerFrame, "Authentication Required", "<html>Host <b>" + scope.getHost() + ":" + scope.getPort() + "</b> requires Windows authentication</html>", true); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new NTCredentials( pwDialog.getUser(), pwDialog.getPassword(), scope.getHost(), pwDialog.getDomain()); pwDialog.dispose(); } else if (scope.getScheme().equals("basic") || scope.getScheme().equals("digest")) { AuthenticationDialog pwDialog = new AuthenticationDialog( ownerFrame, "Authentication Required", "<html><center>Host <b>" + scope.getHost() + ":" + scope.getPort() + "</b>" + " requires authentication for the realm:<br><b>" + scope.getRealm() + "</b></center></html>", false); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new UsernamePasswordCredentials(pwDialog.getUser(), pwDialog.getPassword()); pwDialog.dispose(); } else { throw new InvalidCredentialsException(
/** * Construct modal dialog for display over another Dialog. * * @param owner Dialog over which this dialog will be displayed and centred. * @param title the dialog's title text * @param question the question/statement to prompt the user for their password * @param isNtAuthentication if true a domain name is required in addition to the username and password. */ public AuthenticationDialog(Dialog owner, String title, String question, boolean isNtAuthentication) { super(owner, title, true); this.isNtAuthentication = isNtAuthentication; initGui(question); }
AuthenticationDialog pwDialog = new AuthenticationDialog(ownerFrame, "Authentication Required", "<html>Host <b>" + scope.getHost() + ":" + "</b> requires Windows authentication</html>", true); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new NTCredentials( pwDialog.getUser(), pwDialog.getPassword(), scope.getHost(), pwDialog.getDomain()); pwDialog.dispose(); } else if (scope.getScheme().equals("basic") || scope.getScheme().equals("digest")) { AuthenticationDialog pwDialog = new AuthenticationDialog(ownerFrame, "Authentication Required", "<html><center>Host <b>" + scope.getRealm() + "</b></center></html>", false); pwDialog.setVisible(true); if (pwDialog.getUser().length() > 0) { credentials = new UsernamePasswordCredentials(pwDialog.getUser(), pwDialog.getPassword());