Class Dialog.Builder<B extends Dialog.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
Accessible.Builder<B>,BuilderInterface
- Direct Known Subclasses:
AboutDialog.Builder,AlertDialog.Builder,PreferencesDialog.Builder,ShortcutsDialog.Builder
- Enclosing class:
Dialog
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theDialogobject.Emitted when the close button or shortcut is used, orDialog.close()is called whileDialog:can-closeis set toFALSE.onClosed(Dialog.ClosedCallback handler) Emitted when the dialog is successfully closed.setCanClose(boolean canClose) Whether the dialog can be closed.The child widget of theAdwDialog.setContentHeight(int contentHeight) The height of the dialog's contents.setContentWidth(int contentWidth) The width of the dialog's contents.setDefaultWidget(Widget defaultWidget) The default widget.setFocusWidget(Widget focusWidget) The focus widget.setFollowsContentSize(boolean followsContentSize) Whether to size content automatically.setPresentationMode(DialogPresentationMode presentationMode) The dialog's presentation mode.The title of the dialog.Methods inherited from class org.gnome.gtk.Widget.Builder
onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, setCanFocus, setCanTarget, setCssClasses, setCssName, setCursor, setFocusable, setFocusOnClick, setHalign, setHasTooltip, setHeightRequest, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequestMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRoleMethods inherited from interface org.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theDialogobject. 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 toDialog.- Overrides:
buildin classWidget.Builder<B extends Dialog.Builder<B>>- Returns:
- a new instance of
Dialogwith the properties that were set in the Builder object.
-
setCanClose
Whether the dialog can be closed.If set to
FALSE, the close button, shortcuts andDialog.close()will result inDialog::close-attemptbeing emitted instead, and bottom sheet close swipe will be disabled.Dialog.forceClose()still works.- Parameters:
canClose- the value for thecan-closeproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.5
-
setChild
-
setContentHeight
The height of the dialog's contents.Set it to -1 to reset it to the content's natural height.
See also:
Gtk.Window:default-height- Parameters:
contentHeight- the value for thecontent-heightproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.5
-
setContentWidth
The width of the dialog's contents.Set it to -1 to reset it to the content's natural width.
See also:
Gtk.Window:default-width- Parameters:
contentWidth- the value for thecontent-widthproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.5
-
setDefaultWidget
-
setFocusWidget
-
setFollowsContentSize
Whether to size content automatically.If set to
TRUE, always use the content's natural size instead ofDialog:content-widthandDialog:content-height. If the content resizes, the dialog will immediately resize as well.See also:
Gtk.Window:resizable- Parameters:
followsContentSize- the value for thefollows-content-sizeproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.5
-
setPresentationMode
The dialog's presentation mode.When set to
ADW_DIALOG_AUTO, the dialog appears as a bottom sheet when the following condition is met:max-width: 450px or max-height: 360px, and as a floating window otherwise.Set it to
ADW_DIALOG_FLOATINGorADW_DIALOG_BOTTOM_SHEETto always present it a floating window or a bottom sheet respectively, regardless of available size.Presentation mode does nothing for dialogs presented as a window.
- Parameters:
presentationMode- the value for thepresentation-modeproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.5
-
setTitle
-
onCloseAttempt
Emitted when the close button or shortcut is used, orDialog.close()is called whileDialog:can-closeis set toFALSE.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.5
- See Also:
-
onClosed
Emitted when the dialog is successfully closed.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.5
- See Also:
-