Class TabView.Builder<B extends TabView.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
- Enclosing class:
TabView
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theTabView
object.onClosePage
(TabView.ClosePageCallback handler) Emitted afterTabView.closePage(org.gnome.adw.TabPage)
has been called forpage
.Emitted when a tab should be transferred into a new window.Emitted after the indicator icon onpage
has been activated.Emitted when a page has been created or transferred toself
.Emitted when a page has been removed or transferred to another view.Emitted afterpage
has been reordered toposition
.onSetupMenu
(TabView.SetupMenuCallback handler) Emitted when a context menu is opened or closed forpage
.setDefaultIcon
(Icon defaultIcon) Default page icon.setMenuModel
(MenuModel menuModel) Tab context menu model.setSelectedPage
(TabPage selectedPage) The currently selected page.setShortcuts
(Set<TabViewShortcuts> shortcuts) The enabled shortcuts.setShortcuts
(TabViewShortcuts... shortcuts) The enabled shortcuts.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 theTabView
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 toTabView
.- Overrides:
build
in classWidget.Builder<B extends TabView.Builder<B>>
- Returns:
- a new instance of
TabView
with the properties that were set in the Builder object.
-
setDefaultIcon
Default page icon.If a page doesn't provide its own icon via
TabPage:icon
, a default icon may be used instead for contexts where having an icon is necessary.TabBar
will use default icon for pinned tabs in case the page is not loading, doesn't have an icon and an indicator. Default icon is never used for tabs that aren't pinned.TabOverview
will use default icon for pages with missing thumbnails.By default, the
adw-tab-icon-missing-symbolic
icon is used.- Parameters:
defaultIcon
- the value for thedefault-icon
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMenuModel
Tab context menu model.When a context menu is shown for a tab, it will be constructed from the provided menu model. Use the
TabView::setup-menu
signal to set up the menu actions for the particular tab.- Parameters:
menuModel
- the value for themenu-model
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSelectedPage
-
setShortcuts
The enabled shortcuts.See
TabViewShortcuts
for the list of the available shortcuts. All of the shortcuts are enabled by default.TabView.addShortcuts(java.util.Set<org.gnome.adw.TabViewShortcuts>)
andTabView.removeShortcuts(java.util.Set<org.gnome.adw.TabViewShortcuts>)
provide a convenient way to manage individual shortcuts.- Parameters:
shortcuts
- the value for theshortcuts
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setShortcuts
The enabled shortcuts.See
TabViewShortcuts
for the list of the available shortcuts. All of the shortcuts are enabled by default.TabView.addShortcuts(java.util.Set<org.gnome.adw.TabViewShortcuts>)
andTabView.removeShortcuts(java.util.Set<org.gnome.adw.TabViewShortcuts>)
provide a convenient way to manage individual shortcuts.- Parameters:
shortcuts
- the value for theshortcuts
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onClosePage
Emitted afterTabView.closePage(org.gnome.adw.TabPage)
has been called forpage
.The handler is expected to call
TabView.closePageFinish(org.gnome.adw.TabPage, boolean)
to confirm or reject the closing.The default handler will immediately confirm closing for non-pinned pages, or reject it for pinned pages, equivalent to the following example:
static gboolean close_page_cb (AdwTabView *view, AdwTabPage *page, gpointer user_data) { adw_tab_view_close_page_finish (view, page, !adw_tab_page_get_pinned (page)); return GDK_EVENT_STOP; }
The
TabView.closePageFinish(org.gnome.adw.TabPage, boolean)
call doesn't have to happen inside the handler, so can be used to do asynchronous checks before confirming the closing.A typical reason to connect to this signal is to show a confirmation dialog for closing a tab.
The signal handler should return
GDK_EVENT_STOP
to stop propagation orGDK_EVENT_CONTINUE
to invoke the default handler.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onCreateWindow
Emitted when a tab should be transferred into a new window.This can happen after a tab has been dropped on desktop.
The signal handler is expected to create a new window, position it as needed and return its
AdwTabView
that the page will be transferred into.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onIndicatorActivated
Emitted after the indicator icon onpage
has been activated.See
TabPage:indicator-icon
andTabPage:indicator-activatable
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onPageAttached
Emitted when a page has been created or transferred toself
.A typical reason to connect to this signal would be to connect to page signals for things such as updating window title.
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onPageDetached
Emitted when a page has been removed or transferred to another view.A typical reason to connect to this signal would be to disconnect signal handlers connected in the
TabView::page-attached
handler.It is important not to try and destroy the page child in the handler of this function as the child might merely be moved to another window; use child dispose handler for that or do it in sync with your
TabView.closePageFinish(org.gnome.adw.TabPage, boolean)
calls.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onPageReordered
Emitted afterpage
has been reordered toposition
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSetupMenu
Emitted when a context menu is opened or closed forpage
.If the menu has been closed,
page
will be set toNULL
.It can be used to set up menu actions before showing the menu, for example disable actions not applicable to
page
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-