Class FileDialog.Builder<B extends FileDialog.Builder<B>>

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

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

    • Builder

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

    • build

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

      public B setAcceptLabel(String acceptLabel)
      Label for the file chooser's accept button.
      Parameters:
      acceptLabel - the value for the accept-label property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setDefaultFilter

      public B setDefaultFilter(FileFilter defaultFilter)

      The default filter.

      This filter is initially active in the file chooser dialog.

      If the default filter is NULL, the first filter of Gtk.FileDialog:filters is used as the default filter. If that property contains no filter, the dialog will be unfiltered.

      If Gtk.FileDialog:filters is not NULL, the default filter should be part of the list. If it is not, the dialog may choose to not make it available.

      Parameters:
      defaultFilter - the value for the default-filter property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setFilters

      public B setFilters(ListModel filters)

      The list of filters.

      See Gtk.FileDialog:default-filter about how these two properties interact.

      Parameters:
      filters - the value for the filters property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setInitialFile

      public B setInitialFile(File initialFile)

      The initial file.

      This file is initially selected in the file chooser dialog

      This is a utility property that sets both Gtk.FileDialog:initial-folder and Gtk.FileDialog:initial-name.

      Parameters:
      initialFile - the value for the initial-file property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setInitialFolder

      public B setInitialFolder(File initialFolder)

      The initial folder.

      This is the directory that is initially opened in the file chooser dialog.

      Parameters:
      initialFolder - the value for the initial-folder property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setInitialName

      public B setInitialName(String initialName)

      The initial name.

      This is the name of the file that is initially selected in the file chooser dialog.

      Parameters:
      initialName - the value for the initial-name property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setModal

      public B setModal(boolean modal)
      Whether the file chooser dialog is modal.
      Parameters:
      modal - the value for the modal property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setTitle

      public B setTitle(String title)
      A title that may be shown on the file chooser dialog.
      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10