Class ScriptDialog
-
Constructor Summary
ConstructorsConstructorDescriptionScriptDialog(MemorySegment address) Create a ScriptDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closedialog.voidconfirmSetConfirmed(boolean confirmed) Set whether the user confirmed the dialog.Get the dialog type of aWebKitScriptDialog.Get the message of aWebKitScriptDialog.static @Nullable TypegetType()Get the GType of the ScriptDialog classGet the default text of aWebKitScriptDialogof typeScriptDialogType.PROMPT.voidpromptSetText(String text) Set the text entered by the user in the dialog.ref()Atomically increments the reference count of this ScriptDialog by one.voidunref()Atomically decrements the reference count of this ScriptDialog by one.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ScriptDialog
Create a ScriptDialog proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
-
close
public void close()Closedialog.When handling a
WebKitScriptDialogasynchronously (webkit_script_dialog_ref() was called inWebKitWebView::script-dialog callback), this function needs to be called to notify that we are done with the script dialog. The dialog will be closed on destruction if this function hasn't been called before.- Since:
- 2.24
-
confirmSetConfirmed
public void confirmSetConfirmed(boolean confirmed) Set whether the user confirmed the dialog.This method is used for
ScriptDialogType.CONFIRMandScriptDialogType.BEFORE_UNLOAD_CONFIRMdialogs whenWebKitWebView::script-dialog signal is emitted to set whether the user confirmed the dialog or not. The default implementation ofWebKitWebView::script-dialog signal setstruewhen the OK or Stay buttons are clicked andfalseotherwise. It's an error to use this method with aWebKitScriptDialogthat is not of typeScriptDialogType.CONFIRMorScriptDialogType.BEFORE_UNLOAD_CONFIRM- Parameters:
confirmed- whether user confirmed the dialog
-
getDialogType
Get the dialog type of aWebKitScriptDialog.- Returns:
- the
WebKitScriptDialogTypeof this ScriptDialog
-
getMessage
-
promptGetDefaultText
Get the default text of aWebKitScriptDialogof typeScriptDialogType.PROMPT.It's an error to use this method with a
WebKitScriptDialogthat is not of typeScriptDialogType.PROMPT.- Returns:
- the default text of this ScriptDialog
-
promptSetText
Set the text entered by the user in the dialog.This method is used for
ScriptDialogType.PROMPTdialogs whenWebKitWebView::script-dialog signal is emitted to set the text entered by the user. The default implementation ofWebKitWebView::script-dialog signal sets the text of the entry form when OK button is clicked, otherwisenullis set. It's an error to use this method with aWebKitScriptDialogthat is not of typeScriptDialogType.PROMPT.- Parameters:
text- the text to set
-
ref
Atomically increments the reference count of this ScriptDialog by one.This function is MT-safe and may be called from any thread.
- Returns:
- The passed in
WebKitScriptDialog - Since:
- 2.24
-
unref
public void unref()Atomically decrements the reference count of this ScriptDialog by one.If the reference count drops to 0, all memory allocated by the
WebKitScriptdialogis released. This function is MT-safe and may be called from any thread.- Since:
- 2.24
-