Class Notebook.Builder<B extends Notebook.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Enclosing class:
Notebook

public static class Notebook.Builder<B extends Notebook.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Notebook build()
      Finish building the Notebook object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Notebook.
      Overrides:
      build in class Widget.Builder<B extends Notebook.Builder<B>>
      Returns:
      a new instance of Notebook with the properties that were set in the Builder object.
    • setEnablePopup

      public B setEnablePopup(boolean enablePopup)
      If true, pressing the right mouse button on the notebook shows a page switching menu.
      Parameters:
      enablePopup - the value for the enable-popup property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGroupName

      public B setGroupName(String groupName)
      Group name for tab drag and drop.
      Parameters:
      groupName - the value for the group-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPage

      public B setPage(int page)
      The index of the current page.
      Parameters:
      page - the value for the page property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setScrollable

      public B setScrollable(boolean scrollable)
      If true, scroll arrows are added if there are too many pages to fit.
      Parameters:
      scrollable - the value for the scrollable property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowBorder

      public B setShowBorder(boolean showBorder)
      Whether the border should be shown.
      Parameters:
      showBorder - the value for the show-border property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowTabs

      public B setShowTabs(boolean showTabs)
      Whether tabs should be shown.
      Parameters:
      showTabs - the value for the show-tabs property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTabPos

      public B setTabPos(PositionType tabPos)
      Which side of the notebook holds the tabs.
      Parameters:
      tabPos - the value for the tab-pos property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onChangeCurrentPage

      public B onChangeCurrentPage(Notebook.ChangeCurrentPageCallback handler)

      Emitted when the current page should be changed.

      The default bindings for this signal are Ctrl+Alt+PgUp, Ctrl+Alt+PgDn, Ctrl+PgUp and Ctrl+PgDn.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onCreateWindow

      public B onCreateWindow(Notebook.CreateWindowCallback handler)

      The ::create-window signal is emitted when a detachable tab is dropped on the root window.

      A handler for this signal can create a window containing a notebook where the tab will be attached. It is also responsible for moving/resizing the window and adding the necessary properties to the notebook (e.g. the GtkNotebook:group-name ).

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onFocusTab

      public B onFocusTab(Notebook.FocusTabCallback handler)
      Emitted when a tab should be focused.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onMoveFocusOut

      public B onMoveFocusOut(Notebook.MoveFocusOutCallback handler)

      Emitted when focus was moved out.

      The default bindings for this signal are Ctrl+Tab, Ctrl+Shift+Tab, Ctrl+, Ctrl+, Ctrl+ and Ctrl+.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onPageAdded

      public B onPageAdded(Notebook.PageAddedCallback handler)
      the ::page-added signal is emitted in the notebook right after a page is added to the notebook.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onPageRemoved

      public B onPageRemoved(Notebook.PageRemovedCallback handler)
      the ::page-removed signal is emitted in the notebook right after a page is removed from the notebook.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onPageReordered

      public B onPageReordered(Notebook.PageReorderedCallback handler)
      the ::page-reordered signal is emitted in the notebook right after a page has been reordered.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onReorderTab

      public B onReorderTab(Notebook.ReorderTabCallback handler)

      Emitted when the tab should be reordered.

      The default bindings for this signal are Alt+Home, Alt+End, Alt+PgUp, Alt+PgDn, Alt+, Alt+, Alt+ and Alt+.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSelectPage

      public B onSelectPage(Notebook.SelectPageCallback handler)

      Emitted when a page should be selected.

      The default binding for this signal is .

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSwitchPage

      public B onSwitchPage(Notebook.SwitchPageCallback handler)
      Emitted when the user or a function changes the current page.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: