Package mars.settings

Class SyntaxStyleSetting

java.lang.Object
mars.settings.SyntaxStyleSetting

public class SyntaxStyleSetting extends Object
Class representing a persistent syntax style setting and its current value.
  • Method Details

    • getKey

      public String getKey()
      Get the key used to identify this setting in Preferences.
      Returns:
      The string key for this setting.
    • get

      public SyntaxStyle get()
      Get the value currently stored in this setting.
      Returns:
      The syntax style value for this setting.
    • set

      public void set(SyntaxStyle value)
      Set the value of this setting, updating persistent storage.
      Parameters:
      value - The new syntax style value for this setting.
    • getDefault

      public SyntaxStyle getDefault()
      Get the theme default value for this setting.
      Returns:
      The theme default syntax style value for this setting.
    • getOrDefault

      public SyntaxStyle getOrDefault()
      Get the value currently stored in this setting if it is not null, or the theme default returned by getDefault() otherwise.
      Returns:
      The syntax style value for this setting, or the theme default if not set.
    • setNonPersistent

      public void setNonPersistent(SyntaxStyle value)
      Set the value of this setting without updating persistent storage.
      Parameters:
      value - The new syntax style value for this setting.
    • encode

      public static String encode(SyntaxStyle style)
      Encode a SyntaxStyle object as a string of attributes separated by commas:
      • Color=RGB: Specifies the color as an integer RGB.
      • Bold: Will be present if the bold style flag is set.
      • Italic: Will be present if the italic style flag is set.
      Parameters:
      style - The syntax style to encode as a string.
      Returns:
      The encoded form of the given syntax style, or null if the style is null.
      See Also:
    • decode

      public static SyntaxStyle decode(String string)
      Decode a SyntaxStyle object from a string of attributes separated by commas:
      • Color=RGB: Sets the color to integer RGB. If not present, defaults to null.
      • Bold: If present, sets the bold style flag.
      • Italic: If present, sets the italic style flag.
      Parameters:
      string - The string to decode as a syntax style.
      Returns:
      The syntax style decoded from the given string, or null if string is null.
      See Also: