Class DefaultDialogHandler

Represents default implementation of the DialogHandler
that will display an appropriate UI modal dialog for each method. All dialog texts are localized
with English language. If you need to support other languages or localize the dialogs, please
consider using your own implementation of the DialogHandler.

Constructor Detail

DefaultDialogHandler

Method Detail

onAlert

This method is invoked when JavaScript alert dialog should be displayed. In this
method you can display standard Java modal dialog with the message
that you can get from params. Please note that it's not necessary to
display modal dialog in this method.

While this method is executed the Browser and JavaScript main threads will be blocked.
Right after this method returns, Browser and JavaScript main threads continue
their execution. It means that while this method is blocked, you cannot use any
Browser functionality and you will not receive any events from Browser component. If you
block this method forever, the whole Browser functionality will be blocked forever
as well.

onConfirmation

This method is invoked when JavaScript confirmation dialog should be displayed. In this
method you can display standard Java modal dialog with the message
that you can get from params. Please note that it's not necessary to
display modal dialog in this method.

While this method is executed the Browser and JavaScript main threads will be blocked.
Right after this method returns, Browser and JavaScript main threads continue
their execution. It means that while this method is blocked, you cannot use any
Browser functionality and you will not receive any events from Browser component. If you
block this method forever, the whole Browser functionality will be blocked forever
as well.

onPrompt

This method is invoked when JavaScript prompt dialog should be displayed. In this
method you can display standard Java modal dialog with the message and with text
field with default prompt text that you can get from params.
Please note that it's not necessary to display modal dialog in this method.

The prompt dialog contains a text field with prompt text. User can input any text
in this text field. To provide the new prompt text back to JavaScript use the
PromptDialogParams.setPromptText(String) method.

While this method is executed the Browser and JavaScript main threads will be blocked.
Right after this method returns, Browser and JavaScript main threads continue
their execution. It means that while this method is blocked, you cannot use any
Browser functionality and you will not receive any events from Browser component. If you
block this method forever, the whole Browser functionality will be blocked forever
as well.

onFileChooser

This method is invoked when file selection is to be done. You can use this method to display
a file chooser dialog with the required type that you can find out from the FileChooserParams.getMode() method.

While this method is executed the Browser main threads will be blocked. Right after this
method returns, Browser main threads continue their execution. It means that while this
method is blocked, you cannot use any Browser functionality and you will not receive any
events from Browser component. If you block this method forever, the whole Browser
functionality will be blocked forever as well.

onBeforeUnload

This method is invoked before web page unload. Some web page may override the
window.onbeforeunload JavaScript function, so that a confirmation dialog will
be shown every time when user try to reload web page or navigate to another web page.
You can use this method to display an appropriate confirmation message dialog to
ask user whether he or she really wants to leave or reload the web page. To find out
whether web page will be reloaded you can check the
UnloadDialogParams.isReload() method.

While this method is executed the Browser main threads will be blocked. Right after
this method returns, Browser main threads continue their execution. It means that
while this method is blocked, you cannot use any Browser functionality and you will
not receive any events from Browser component. If you block this method forever,
the whole Browser functionality will be blocked forever as well.

onColorChooser

This method is invoked when user selects HTML5 input element with type=color.
You can use this method to display your own color chooser dialog or set required color
programmatically without displaying any dialogs.