Class Dialog.Builder<B extends Dialog.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
- Direct Known Subclasses:
AboutDialog.Builder
,AlertDialog.Builder
,PreferencesDialog.Builder
- Enclosing class:
Dialog
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theDialog
object.Emitted when the close button or shortcut is used, orDialog.close()
is called whileDialog:can-close
is 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, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequest
Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRole
Methods inherited from interface io.github.jwharm.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theDialog
object. 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:
build
in classWidget.Builder<B extends Dialog.Builder<B>>
- Returns:
- a new instance of
Dialog
with 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-attempt
being emitted instead, and bottom sheet close swipe will be disabled.Dialog.forceClose()
still works.- Parameters:
canClose
- the value for thecan-close
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
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-height
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
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-width
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDefaultWidget
-
setFocusWidget
-
setFollowsContentSize
Whether to size content automatically.If set to
TRUE
, always use the content's natural size instead ofDialog:content-width
andDialog: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-size
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
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_FLOATING
orADW_DIALOG_BOTTOM_SHEET
to 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-mode
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTitle
-
onCloseAttempt
Emitted when the close button or shortcut is used, orDialog.close()
is called whileDialog:can-close
is set toFALSE
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onClosed
Emitted when the dialog is successfully closed.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-