Class ScrolledWindow.Builder<B extends ScrolledWindow.Builder<B>>

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

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

      public B setChild(Widget child)

      The child widget.

      When setting this property, if the child widget does not implement Scrollable, the scrolled window will add the child to a Viewport and then set the viewport as the child.

      Parameters:
      child - the value for the child property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHadjustment

      public B setHadjustment(Adjustment hadjustment)
      The GtkAdjustment for the horizontal position.
      Parameters:
      hadjustment - the value for the hadjustment property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHasFrame

      public B setHasFrame(boolean hasFrame)
      Whether to draw a frame around the contents.
      Parameters:
      hasFrame - the value for the has-frame property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHscrollbarPolicy

      public B setHscrollbarPolicy(PolicyType hscrollbarPolicy)

      When the horizontal scrollbar is displayed.

      Use ScrolledWindow.setPolicy(PolicyType, PolicyType) to set this property.

      Parameters:
      hscrollbarPolicy - the value for the hscrollbar-policy property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setKineticScrolling

      public B setKineticScrolling(boolean kineticScrolling)

      Whether kinetic scrolling is enabled or not.

      Kinetic scrolling only applies to devices with source InputSource.TOUCHSCREEN.

      Parameters:
      kineticScrolling - the value for the kinetic-scrolling property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMaxContentHeight

      public B setMaxContentHeight(int maxContentHeight)
      The maximum content height of scrolledWindow.
      Parameters:
      maxContentHeight - the value for the max-content-height property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMaxContentWidth

      public B setMaxContentWidth(int maxContentWidth)
      The maximum content width of scrolledWindow.
      Parameters:
      maxContentWidth - the value for the max-content-width property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMinContentHeight

      public B setMinContentHeight(int minContentHeight)
      The minimum content height of scrolledWindow.
      Parameters:
      minContentHeight - the value for the min-content-height property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMinContentWidth

      public B setMinContentWidth(int minContentWidth)
      The minimum content width of scrolledWindow.
      Parameters:
      minContentWidth - the value for the min-content-width property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setOverlayScrolling

      public B setOverlayScrolling(boolean overlayScrolling)

      Whether overlay scrolling is enabled or not.

      If it is, the scrollbars are only added as traditional widgets when a mouse is present. Otherwise, they are overlaid on top of the content, as narrow indicators.

      Note that overlay scrolling can also be globally disabled, with the Gtk.Settings:gtk-overlay-scrolling setting.

      Parameters:
      overlayScrolling - the value for the overlay-scrolling property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPropagateNaturalHeight

      public B setPropagateNaturalHeight(boolean propagateNaturalHeight)

      Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.

      This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.

      Parameters:
      propagateNaturalHeight - the value for the propagate-natural-height property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPropagateNaturalWidth

      public B setPropagateNaturalWidth(boolean propagateNaturalWidth)

      Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.

      This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.

      Parameters:
      propagateNaturalWidth - the value for the propagate-natural-width property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVadjustment

      public B setVadjustment(Adjustment vadjustment)
      The GtkAdjustment for the vertical position.
      Parameters:
      vadjustment - the value for the vadjustment property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVscrollbarPolicy

      public B setVscrollbarPolicy(PolicyType vscrollbarPolicy)

      When the vertical scrollbar is displayed.

      Use ScrolledWindow.setPolicy(PolicyType, PolicyType) to set this property.

      Parameters:
      vscrollbarPolicy - the value for the vscrollbar-policy property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWindowPlacement

      public B setWindowPlacement(CornerType windowPlacement)
      Where the contents are located with respect to the scrollbars.
      Parameters:
      windowPlacement - the value for the window-placement property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onEdgeOvershot

      public B onEdgeOvershot(ScrolledWindow.EdgeOvershotCallback handler)

      Emitted whenever user initiated scrolling makes the scrolled window firmly surpass the limits defined by the adjustment in that orientation.

      A similar behavior without edge resistance is provided by the Gtk.ScrolledWindow::edge-reached signal.

      Note: The pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.

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

      public B onEdgeReached(ScrolledWindow.EdgeReachedCallback handler)

      Emitted whenever user-initiated scrolling makes the scrolled window exactly reach the lower or upper limits defined by the adjustment in that orientation.

      A similar behavior with edge resistance is provided by the Gtk.ScrolledWindow::edge-overshot signal.

      Note: The pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.

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

      public B onMoveFocusOut(ScrolledWindow.MoveFocusOutCallback handler)

      Emitted when focus is moved away from the scrolled window by a keybinding.

      This is a keybinding signal.

      The default bindings for this signal are Ctrl+Tab to move forward and Ctrl+Shift+Tab` to move backward.

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

      public B onScrollChild(ScrolledWindow.ScrollChildCallback handler)

      Emitted when a keybinding that scrolls is pressed.

      This is a keybinding signal.

      The horizontal or vertical adjustment is updated which triggers a signal that the scrolled window’s child may listen to and scroll itself.

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