Class StyleScheme

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class StyleScheme extends GObject

Controls the appearance of View.

GtkSourceStyleScheme contains all the text styles to be used in View and Buffer. For instance, it contains text styles for syntax highlighting, it may contain foreground and background color for non-highlighted text, color for the line numbers, current line highlighting, bracket matching, etc.

Style schemes are stored in XML files. The format of a scheme file is documented in the style scheme reference.

The two style schemes with IDs "classic" and "tango" follow more closely the GTK theme (for example for the background color).

  • Constructor Details

    • StyleScheme

      public StyleScheme(MemorySegment address)
      Create a StyleScheme instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • StyleScheme

      public StyleScheme()
      Create a new StyleScheme.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the StyleScheme class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected StyleScheme asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • getAuthors

      public @Nullable String @Nullable [] getAuthors()
    • getDescription

      public @Nullable String getDescription()
    • getFilename

      public @Nullable String getFilename()
    • getId

      public String getId()
    • getMetadata

      public @Nullable String getMetadata(String name)
      Gets a metadata property from the style scheme.
      Parameters:
      name - metadata property name.
      Returns:
      value of property name stored in the metadata of this StyleScheme or null if this StyleScheme does not contain the specified metadata property.
      Since:
      5.4
    • getName

      public String getName()
    • getStyle

      public @Nullable Style getStyle(String styleId)
    • builder

      public static StyleScheme.Builder<? extends StyleScheme.Builder> builder()
      A StyleScheme.Builder object constructs a StyleScheme with the specified properties. Use the various set...() methods to set properties, and finish construction with StyleScheme.Builder.build().
      Returns:
      the builder object