public class PromptEvent extends EventObject
PromptEvent
will be invoked in an
IMozillaBrowserCanvas
for any dialog shown.
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.
Modifier and Type | Field and Description |
---|---|
static int |
BUTTON_0
Constant representing button 0 of a
DIALOG_CONFIRM_EX dialog. |
static int |
BUTTON_1
Constant representing button 1 of a
DIALOG_CONFIRM_EX dialog. |
static int |
BUTTON_2
Constant representing button 2 of a
DIALOG_CONFIRM_EX dialog. |
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.
|
static int |
DIALOG_ALERT
An alert dialog with an OK button.
|
static int |
DIALOG_ALERT_CHECK
An alert dialog with an OK button and a check box.
|
static int |
DIALOG_CONFIRM
A dialog with OK and Cancel buttons.
|
static int |
DIALOG_CONFIRM_CHECK
A dialog with OK and Cancel buttons and a check box.
|
static int |
DIALOG_CONFIRM_EX
A dialog with up to 3 buttons and an optional checkbox.
|
static int |
DIALOG_PROMPT
A dialog with an edit field and an optional checkbox.
|
static int |
DIALOG_PROMPT_PASSWORD
A dialog with a password field and an optional checkbox.
|
static int |
DIALOG_PROMPT_USERNAME_AND_PASSWORD
A dialog with an edit field, a password field, and an optional checkbox.
|
static int |
DIALOG_SAVE_TO_DISK
A save to disk dialog.
|
source
Constructor and Description |
---|
PromptEvent(Object source,
int DlgType)
Constructor for PromptEvent with a source.
|
PromptEvent(Object source,
int DlgType,
String DialogTitle,
String DialogText,
String CheckMsg,
String Btn0Title,
String Btn1Title,
String Btn2Title,
String aURL) |
Modifier and Type | Method and Description |
---|---|
void |
blockPromptDialog()
Stops the dialog associated with this event from being shown.
|
boolean |
getBlockPromptDialog() |
String |
getButton0Title()
Returns the Title of Button 0;
|
String |
getButton1Title()
Returns the Title of Button 1;
|
String |
getButton2Title()
Returns the Title of Button 2;
|
int |
getButtonResult()
Returns the Result;
|
String |
getCheckText()
Returns the Check Box Text;
|
boolean |
getCheckValue()
Returns the Check Value;
|
String |
getDialogText()
Returns the Dialog Text;
|
String |
getDialogTitle()
Returns the Dialog Title.
|
int |
getDialogType()
Returns the DialogType.
|
String |
getFileName()
The suggested filename for save to disk dialogs.
|
String |
getFileSavePath()
Returns the path that a
DIALOG_SAVE_TO_DISK dialog will save to,
or null if no download path has been set. |
String |
getPassword() |
String |
getURL()
The remote file to download for save to disk dialogs or
the URL of the window creating the dialog.
|
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 |
setFileSavePath(String fileSavePath)
For
DIALOG_SAVE_TO_DISK events, sets the path that the file will
be downloaded to. |
void |
setPassword(String string)
Sets the password for the prompt
|
void |
setURL(String url) |
void |
setUserName(String string)
Sets the username for the prompt
|
getSource, toString
public static final int DIALOG_ALERT
public static final int DIALOG_ALERT_CHECK
public static final int DIALOG_CONFIRM
public static final int DIALOG_CONFIRM_CHECK
public static final int DIALOG_CONFIRM_EX
public static final int DIALOG_PROMPT_PASSWORD
public static final int DIALOG_PROMPT_USERNAME_AND_PASSWORD
public static final int DIALOG_PROMPT
public static final int DIALOG_SAVE_TO_DISK
public static final int BUTTON_OK
public static final int BUTTON_CANCEL
public static final int BUTTON_YES
public static final int BUTTON_NO
public static final int BUTTON_0
DIALOG_CONFIRM_EX
dialog.getButton0Title()
public static final int BUTTON_1
DIALOG_CONFIRM_EX
dialog.getButton1Title()
public static final int BUTTON_2
DIALOG_CONFIRM_EX
dialog.getButton2Title()
public PromptEvent(Object source, int DlgType)
EventObject.EventObject(Object)
public void blockPromptDialog()
public boolean getBlockPromptDialog()
public int getDialogType()
public void setDialogType(int dlgtype)
dlgtype
- The DialogType to setpublic String getPassword()
public String getUserName()
public void setPassword(String string)
string
- public void setUserName(String string)
string
- public String getDialogTitle()
public String getDialogText()
public String getCheckText()
public boolean getCheckValue()
public void setCheckValue(boolean bVal)
public String getButton0Title()
BUTTON_0
public String getButton1Title()
BUTTON_1
public String getButton2Title()
BUTTON_2
public int getButtonResult()
public void setButtonResult(int iVal)
BUTTON_OK
BUTTON_CANCEL
BUTTON_YES
BUTTON_NO
BUTTON_0
BUTTON_1
BUTTON_2
public String getFileName()
public String getURL()
public void setURL(String url)
public void setFileSavePath(String fileSavePath)
DIALOG_SAVE_TO_DISK
events, sets the path that the file will
be downloaded to. Calling this method will suppress the default save dialog.fileSavePath
- An absolute path that includes the name of the file to be saved.public String getFileSavePath()
DIALOG_SAVE_TO_DISK
dialog will save to,
or null
if no download path has been set.