Class FileSaver.Builder<B extends FileSaver.Builder<B>>

java.lang.Object
org.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gtksourceview.FileSaver.Builder<B>
Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
FileSaver

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

      public B setBuffer(Buffer buffer)
      The GtkSourceBuffer to save. The GtkSourceFileSaver object has a weak reference to the buffer.
      Parameters:
      buffer - the value for the buffer property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setCompressionType

      public B setCompressionType(CompressionType compressionType)
      The compression type.
      Parameters:
      compressionType - the value for the compression-type property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setEncoding

      public B setEncoding(Encoding encoding)
      The file's encoding.
      Parameters:
      encoding - the value for the encoding property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFile

      public B setFile(File file)
      The GtkSourceFile. The GtkSourceFileSaver object has a weak reference to the file.
      Parameters:
      file - the value for the file property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFlags

      public B setFlags(Set<FileSaverFlags> flags)
      File saving flags.
      Parameters:
      flags - the value for the flags property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLocation

      public B setLocation(File location)
      The GFile where to save the buffer. By default the location is taken from the GtkSourceFile at construction time.
      Parameters:
      location - the value for the location property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setNewlineType

      public B setNewlineType(NewlineType newlineType)
      The newline type.
      Parameters:
      newlineType - the value for the newline-type property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFlags

      public B setFlags(FileSaverFlags... flags)
      File saving flags.
      Parameters:
      flags - the value for the flags property
      Returns:
      the Builder instance is returned, to allow method chaining