Class Image.Builder<B extends Image.Builder<B>>

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

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

      public B setFile(String file)
      A path to the file to display.
      Parameters:
      file - the value for the file property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGicon

      public B setGicon(Icon gicon)

      The GIcon displayed in the GtkImage.

      For themed icons, If the icon theme is changed, the image will be updated automatically.

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

      public B setIconName(String iconName)

      The name of the icon in the icon theme.

      If the icon theme is changed, the image will be updated automatically.

      Parameters:
      iconName - the value for the icon-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIconSize

      public B setIconSize(IconSize iconSize)
      The symbolic size to display icons at.
      Parameters:
      iconSize - the value for the icon-size property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPaintable

      public B setPaintable(Paintable paintable)
      The GdkPaintable to display.
      Parameters:
      paintable - the value for the paintable property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPixelSize

      public B setPixelSize(int pixelSize)

      The size in pixels to display icons at.

      If set to a value != -1, this property overrides the Gtk.Image:icon-size property for images of type GTK_IMAGE_ICON_NAME.

      Parameters:
      pixelSize - the value for the pixel-size property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setResource

      public B setResource(String resource)
      A path to a resource file to display.
      Parameters:
      resource - the value for the resource property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUseFallback

      public B setUseFallback(boolean useFallback)

      Whether the icon displayed in the GtkImage will use standard icon names fallback.

      The value of this property is only relevant for images of type ImageType.ICON_NAME and ImageType.GICON.

      Parameters:
      useFallback - the value for the use-fallback property
      Returns:
      the Builder instance is returned, to allow method chaining