Package mars.settings
Class SyntaxStyleSetting
java.lang.Object
mars.settings.SyntaxStyleSetting
Class representing a persistent syntax style setting and its current value.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SyntaxStyle
Decode aSyntaxStyle
object from a string of attributes separated by commas:Color=RGB
: Sets the color to integerRGB
.static String
encode
(SyntaxStyle style) Encode aSyntaxStyle
object as a string of attributes separated by commas:Color=RGB
: Specifies the color as an integerRGB
.get()
Get the value currently stored in this setting.Get the theme default value for this setting.getKey()
Get the key used to identify this setting inPreferences
.Get the value currently stored in this setting if it is notnull
, or the theme default returned bygetDefault()
otherwise.void
set
(SyntaxStyle value) Set the value of this setting, updating persistent storage.void
setNonPersistent
(SyntaxStyle value) Set the value of this setting without updating persistent storage.
-
Method Details
-
getKey
Get the key used to identify this setting inPreferences
.- Returns:
- The string key for this setting.
-
get
Get the value currently stored in this setting.- Returns:
- The syntax style value for this setting.
-
set
Set the value of this setting, updating persistent storage.- Parameters:
value
- The new syntax style value for this setting.
-
getDefault
Get the theme default value for this setting.- Returns:
- The theme default syntax style value for this setting.
-
getOrDefault
Get the value currently stored in this setting if it is notnull
, or the theme default returned bygetDefault()
otherwise.- Returns:
- The syntax style value for this setting, or the theme default if not set.
-
setNonPersistent
Set the value of this setting without updating persistent storage.- Parameters:
value
- The new syntax style value for this setting.
-
encode
Encode aSyntaxStyle
object as a string of attributes separated by commas:Color=RGB
: Specifies the color as an integerRGB
.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
Decode aSyntaxStyle
object from a string of attributes separated by commas:Color=RGB
: Sets the color to integerRGB
. 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:
-