Class LinkButton.Builder<B extends LinkButton.Builder<B>>

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

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

      public B setUri(String uri)
      The URI bound to this button.
      Parameters:
      uri - the value for the uri property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVisited

      public B setVisited(boolean visited)

      The 'visited' state of this button.

      A visited link is drawn in a different color.

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

      public B onActivateLink(LinkButton.ActivateLinkCallback handler)

      Emitted each time the GtkLinkButton is clicked.

      The default handler will call FileLauncher.launch(Window, Cancellable, AsyncReadyCallback) with the URI stored inside the Gtk.LinkButton:uri property.

      To override the default behavior, you can connect to the ::activate-link signal and stop the propagation of the signal by returning true from your handler.

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