Class BottomSheet.Builder<B extends BottomSheet.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
- Enclosing class:
BottomSheet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theBottomSheet
object.Emitted when the close button or shortcut is used whileDialog:can-close
is set toFALSE
.setAlign
(float align) Horizontal alignment of the bottom sheet.setBottomBar
(Widget bottomBar) The bottom bar widget.setCanClose
(boolean canClose) Whether the bottom sheet can be closed by user.setCanOpen
(boolean canOpen) Whether the bottom sheet can be opened by user.setContent
(Widget content) The content widget.setFullWidth
(boolean fullWidth) Whether the bottom sheet takes the full width.setModal
(boolean modal) Whether the bottom sheet is modal.setOpen
(boolean open) Whether the bottom sheet is open.The bottom sheet widget.setShowDragHandle
(boolean showDragHandle) Whether to overlay a drag handle in the bottom sheet.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 theBottomSheet
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 toBottomSheet
.- Overrides:
build
in classWidget.Builder<B extends BottomSheet.Builder<B>>
- Returns:
- a new instance of
BottomSheet
with the properties that were set in the Builder object.
-
setAlign
Horizontal alignment of the bottom sheet.0 means the bottom sheet is flush with the start edge, 1 means it's flush with the end edge. 0.5 means it's centered.
Only used when
BottomSheet:full-width
is set toFALSE
.- Parameters:
align
- the value for thealign
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setBottomBar
-
setCanClose
Whether the bottom sheet can be closed by user.It can be closed via the close button, swiping down, pressing
Escape
or clicking the content dimming (when modal).Bottom sheet can still be closed using
BottomSheet:open
.- Parameters:
canClose
- the value for thecan-close
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setCanOpen
Whether the bottom sheet can be opened by user.It can be opened via clicking or swiping up from the bottom bar.
Does nothing if
BottomSheet:bottom-bar
is not set.Bottom sheet can still be opened using
BottomSheet:open
.- Parameters:
canOpen
- the value for thecan-open
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setContent
-
setFullWidth
Whether the bottom sheet takes the full width.When full width,
BottomSheet:align
is ignored.- Parameters:
fullWidth
- the value for thefull-width
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setModal
Whether the bottom sheet is modal.When modal,
BottomSheet:content
will be dimmed when the bottom sheet is open, and clicking it will close the bottom sheet. It also cannot be focused with keyboard.Otherwise, the content is accessible even when the bottom sheet is open.
- Parameters:
modal
- the value for themodal
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setOpen
Whether the bottom sheet is open.- Parameters:
open
- the value for theopen
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSheet
-
setShowDragHandle
Whether to overlay a drag handle in the bottom sheet.The handle will be overlaid over
BottomSheet:sheet
.When the handle is shown,
HeaderBar
will hide its default title, andToolbarView
will reserve space if there are no top bars.Showing drag handle also allows to swipe the bottom sheet down (and to swipe the bottom bar up) with a pointer, instead of just touchscreen.
- Parameters:
showDragHandle
- the value for theshow-drag-handle
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onCloseAttempt
Emitted when the close button or shortcut is used whileDialog:can-close
is set toFALSE
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-