Class SidebarItem.Builder<B extends SidebarItem.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
SidebarItem

public static class SidebarItem.Builder<B extends SidebarItem.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
1.9
  • Constructor Details

    • Builder

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

    • build

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

      public B setDragMotionActivate(boolean dragMotionActivate)

      Whether to activate the item on pointer motion during Drag-and-Drop.

      This is needed to be able to drag content into the page the item represents, when the sidebar is used as a page switcher. However, it may be unwanted when dropping content onto the item itself, so it can be disabled.

      Parameters:
      dragMotionActivate - the value for the drag-motion-activate property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setEnabled

      public B setEnabled(boolean enabled)

      Whether the item is enabled.

      See Gtk.Widget:sensitive.

      Parameters:
      enabled - the value for the enabled property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setIconName

      public B setIconName(String iconName)

      The icon name for this item.

      Mutually exclusive with SidebarItem:icon-paintable.

      Parameters:
      iconName - the value for the icon-name property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setIconPaintable

      public B setIconPaintable(Paintable iconPaintable)

      The paintable to use as the icon for this item.

      Mutually exclusive with SidebarItem:icon-name.

      Parameters:
      iconPaintable - the value for the icon-paintable property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setSubtitle

      public B setSubtitle(String subtitle)
      Subtitle of the item.
      Parameters:
      subtitle - the value for the subtitle property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setSuffix

      public B setSuffix(Widget suffix)

      The suffix widget for this item.

      Suffix will be shown at the end of the item's row, or before the arrow in the Adw.SidebarMode.page mode.

      Parameters:
      suffix - the value for the suffix property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setTitle

      public B setTitle(String title)
      Title of the item.
      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setTooltip

      public B setTooltip(String tooltip)

      The tooltip of the item.

      The tooltip can be marked up with the Pango text markup language.

      Parameters:
      tooltip - the value for the tooltip property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setUseUnderline

      public B setUseUnderline(boolean useUnderline)

      Whether an underline in the title indicates a mnemonic.

      The mnemonic can be used to activate the item.

      Parameters:
      useUnderline - the value for the use-underline property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setVisible

      public B setVisible(boolean visible)
      Whether the item is visible.
      Parameters:
      visible - the value for the visible property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9