com.webrenderer.se.event
Class PromptEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.webrenderer.se.event.PromptEvent
All Implemented Interfaces:
java.io.Serializable

public class PromptEvent
extends java.util.EventObject

An event which indicates that the browser is about to show a dialog. Currently, a PromptEvent will be invoked in an IMozillaBrowserCanvas for any dialog shown, and in an IIEBrowserCanvas for javascript alert dialogs.

If getDialogType() == PromptEvent.AllowPromptUsernameAndPassword, then calling setUserName and SetPassword will bypass showing the dialog by using the username and password specified.

blockPromptDialog() if called will stop the dialog from showing. This shouldn't be called if you set the username and password.

To reduce the cost of multiple method invocations, the event object will record the new data pertaining to the event.

See Also:
Serialized Form

Field Summary
static int AlertCheck
          Allows an alert dialog with an OK button and
static int AllowAlert
          Allows an alert dialog with an OK button.
static int AllowConfirm
          Allows a dialog with OK and Cancel buttons.
static int AllowConfirmCheck
          Allows a dialog with OK and Cancel buttons
static int AllowConfirmEx
          Allows a dialog with up to 3 buttons and an optional checkbox.
static int AllowPrompt
          Allows a dialog with an edit field and an optional checkbox.
static int AllowPromptPassword
          Allows a dialog with a password field and an optional checkbox.
static int AllowPromptUsernameAndPassword
          Allows a dialog with an edit field, a password field, and an optional checkbox.
protected  boolean bCheckValue
           
static int BUTTON_CANCEL
          Constant representing CANCEL button.
static int BUTTON_NO
          Constant representing NO button.
static int BUTTON_OK
          Constant representing OK button.
static int BUTTON_YES
          Constant representing YES button.
protected  int DialogType
           
protected  int iResult
           
protected  java.lang.String password
           
protected  boolean result
           
protected  java.lang.String strDialogText
           
protected  java.lang.String strDialogTitle
           
protected  java.lang.String userName
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PromptEvent(java.lang.Object source, int DlgType)
          Constructor for PromptEvent with a source.
PromptEvent(java.lang.Object source, int DlgType, java.lang.String DialogTitle, java.lang.String DialogText)
           
 
Method Summary
 void blockPromptDialog()
          Stops the dialog associated with this event from being shown.
 boolean getBlockPromptDialog()
           
 int getButtonResult()
          Returns the Result;
 boolean getCheckValue()
          Returns the Check Value;
 java.lang.String getDialogText()
          Returns the Dialog Text;
 java.lang.String getDialogTitle()
          Returns the Dialog Title.
 int getDialogType()
          Returns the DialogType.
 java.lang.String getPassword()
           
 java.lang.String getUserName()
           
 void setButtonResult(int iVal)
          Sets the button that should be pressed.
 void setCheckValue(boolean bVal)
          Sets the Check Value
 void setDialogType(int dlgtype)
          Sets the DialogType.
 void setPassword(java.lang.String string)
          Sets the password for the prompt
 void setPromptText(java.lang.String string)
          Sets the textfield text for the prompt
 void setUserName(java.lang.String string)
          Sets the username for the prompt
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AllowAlert

public static final int AllowAlert
Allows an alert dialog with an OK button.

See Also:
Constant Field Values

AlertCheck

public static final int AlertCheck
Allows an alert dialog with an OK button and

See Also:
Constant Field Values

AllowConfirm

public static final int AllowConfirm
Allows a dialog with OK and Cancel buttons.

See Also:
Constant Field Values

AllowConfirmCheck

public static final int AllowConfirmCheck
Allows a dialog with OK and Cancel buttons

See Also:
Constant Field Values

AllowConfirmEx

public static final int AllowConfirmEx
Allows a dialog with up to 3 buttons and an optional checkbox.

See Also:
Constant Field Values

AllowPromptPassword

public static final int AllowPromptPassword
Allows a dialog with a password field and an optional checkbox.

See Also:
Constant Field Values

AllowPromptUsernameAndPassword

public static final int AllowPromptUsernameAndPassword
Allows a dialog with an edit field, a password field, and an optional checkbox.

See Also:
Constant Field Values

AllowPrompt

public static final int AllowPrompt
Allows a dialog with an edit field and an optional checkbox.

See Also:
Constant Field Values

BUTTON_OK

public static final int BUTTON_OK
Constant representing OK button.

See Also:
Constant Field Values

BUTTON_CANCEL

public static final int BUTTON_CANCEL
Constant representing CANCEL button.

See Also:
Constant Field Values

BUTTON_YES

public static final int BUTTON_YES
Constant representing YES button.

See Also:
Constant Field Values

BUTTON_NO

public static final int BUTTON_NO
Constant representing NO button.

See Also:
Constant Field Values

DialogType

protected int DialogType

result

protected boolean result

userName

protected java.lang.String userName

password

protected java.lang.String password

strDialogTitle

protected java.lang.String strDialogTitle

bCheckValue

protected boolean bCheckValue

strDialogText

protected java.lang.String strDialogText

iResult

protected int iResult
Constructor Detail

PromptEvent

public PromptEvent(java.lang.Object source,
                   int DlgType)
Constructor for PromptEvent with a source.

See Also:
EventObject.EventObject(Object)

PromptEvent

public PromptEvent(java.lang.Object source,
                   int DlgType,
                   java.lang.String DialogTitle,
                   java.lang.String DialogText)
Method Detail

blockPromptDialog

public void blockPromptDialog()
Stops the dialog associated with this event from being shown. Do not call this if you set the username and password.


getBlockPromptDialog

public boolean getBlockPromptDialog()

getDialogType

public int getDialogType()
Returns the DialogType.

Returns:
int

setDialogType

public void setDialogType(int dlgtype)
Sets the DialogType.

Parameters:
dlgtype - The DialogType to set

getPassword

public java.lang.String getPassword()
Returns:
password

getUserName

public java.lang.String getUserName()
Returns:
username

setPassword

public void setPassword(java.lang.String string)
Sets the password for the prompt

Parameters:
string -

setUserName

public void setUserName(java.lang.String string)
Sets the username for the prompt

Parameters:
string -

setPromptText

public void setPromptText(java.lang.String string)
Sets the textfield text for the prompt

Parameters:
string -

getDialogTitle

public java.lang.String getDialogTitle()
Returns the Dialog Title.

Returns:
String

getDialogText

public java.lang.String getDialogText()
Returns the Dialog Text;

Returns:
String

getCheckValue

public boolean getCheckValue()
Returns the Check Value;

Returns:
String

setCheckValue

public void setCheckValue(boolean bVal)
Sets the Check Value


getButtonResult

public int getButtonResult()
Returns the Result;

Returns:
String

setButtonResult

public void setButtonResult(int iVal)
Sets the button that should be pressed.
The following constants are accepted: