Class NativeDialog.Builder<B extends NativeDialog.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
FileChooserNative.Builder
Enclosing class:
NativeDialog

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

      public B setModal(boolean modal)
      Whether the window should be modal with respect to its transient parent.
      Parameters:
      modal - the value for the modal property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTitle

      public B setTitle(String title)
      The title of the dialog window
      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTransientFor

      public B setTransientFor(Window transientFor)
      The transient parent of the dialog, or null for none.
      Parameters:
      transientFor - the value for the transient-for property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVisible

      public B setVisible(boolean visible)
      Whether the window is currently visible.
      Parameters:
      visible - the value for the visible property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onResponse

      public B onResponse(NativeDialog.ResponseCallback handler)

      Emitted when the user responds to the dialog.

      When this is called the dialog has been hidden.

      If you call NativeDialog.hide() before the user responds to the dialog this signal will not be emitted.

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