1 /*******************************************************************************
2 * Copyright (c) 2003, 2009 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.browser;
16 import org.eclipse.swt.widgets.*;
17 import org.eclipse.swt.events.*;
20 * An <code>AuthenticationEvent</code> is sent by a {@link Browser}
21 * to {@link AuthenticationListener}'s when the <code>Browser</code>
22 * navigates to a page that requires authentication. This event allows
23 * a client to either supply authentication credentials, cancel the
24 * authentication, or do nothing (which causes an authentication prompter
25 * to be shown to the user).
29 public class AuthenticationEvent extends TypedEvent {
30 /** The location that triggered the authentication challenge */
31 public String location;
33 /** The user name to authenticate with */
36 /** The password to authenticate with */
37 public String password;
40 * A flag indicating whether the authentication should proceed.
41 * Setting this field to <code>false</code> will cancel the operation.
43 public boolean doit = true;
45 static final long serialVersionUID = -8322331206780057921L;
48 * Constructs a new instance of this class.
50 * @param widget the widget that fired the event
54 public AuthenticationEvent(Widget widget) {
59 * Returns a string containing a concise, human-readable
60 * description of the receiver.
62 * @return a string representation of the event
65 public String toString() {
66 String string = super.toString ();
67 return string.substring (0, string.length() - 1) // remove trailing '}'
69 + " password=" + password
70 + " location=" + location