Class AlertDialog.Builder<B extends AlertDialog.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
AlertDialog
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theAlertDialogobject.setButtons(String[] buttons) Labels for buttons to show in the alert.setCancelButton(int cancelButton) Determines what happens when theEscapekey is pressed while the alert is shown.setDefaultButton(int defaultButton) Determines what happens when theReturnkey is pressed while the alert is shown.The detail text for the alert.setMessage(String message) The message for the alert.setModal(boolean modal) Whether the alert is modal.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theAlertDialogobject. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])to create a new GObject instance, which is then cast toAlertDialog.- Overrides:
buildin classGObject.Builder<B extends AlertDialog.Builder<B>>- Returns:
- a new instance of
AlertDialogwith the properties that were set in the Builder object.
-
setButtons
Labels for buttons to show in the alert.The labels should be translated and may contain a
_character to indicate the mnemonic character.If this property is not set, then a 'Close' button is automatically created.
- Parameters:
buttons- the value for thebuttonsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.10
-
setCancelButton
Determines what happens when theEscapekey is pressed while the alert is shown.If this property holds the index of a button in
Gtk.AlertDialog:buttons, then pressing Escape is treated as if that button was pressed. If it is -1 or not a valid index for thebuttonsarray, then an error is returned.If
buttonsisNULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.- Parameters:
cancelButton- the value for thecancel-buttonproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.10
-
setDefaultButton
Determines what happens when theReturnkey is pressed while the alert is shown.If this property holds the index of a button in
Gtk.AlertDialog:buttons, then pressing Return is treated as if that button was pressed. If it is -1 or not a valid index for thebuttonsarray, then nothing happens.If
buttonsisNULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.- Parameters:
defaultButton- the value for thedefault-buttonproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.10
-
setDetail
-
setMessage
-
setModal
Whether the alert is modal.- Parameters:
modal- the value for themodalproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 4.10
-