class ThemeManager
extends Object
Manages theme state (light/dark/system) for GroovyConsole.
| Modifiers | Name | Description |
|---|---|---|
static enum |
ThemeManager.ThemeMode |
| Type | Name and description |
|---|---|
String |
customDarkPath |
String |
customLightPath |
| Constructor and description |
|---|
ThemeManager() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static void |
addThemeChangeListener(Runnable listener) |
|
static void |
applyTheme(ThemeManager.ThemeMode mode) |
|
static ThemeManager.ThemeMode |
cycleMode() |
|
static ThemeManager.ThemeMode |
getCurrentMode() |
|
static String |
getCustomDarkPath() |
|
static String |
getCustomLightPath() |
|
static Color |
getInputBackground() |
|
static Color |
getMenuIconForeground()Foreground color for menu-item icons — OS-tinted on the mac screen menu bar, app-tinted otherwise. |
|
static Color |
getOutputBackground() |
|
static Map |
getStyleAttrs(String key)Returns the attributes for a single theme style key as a plain map (foreground/background Colors plus bold/italic/underline Booleans). |
|
static Map |
getStyles(String fontFamily) |
|
static String |
getThemeLabel() |
|
static boolean |
isDark() |
|
static boolean |
isMenuDark()True iff menu-item icons will paint against a dark background. |
|
static boolean |
isMenuDrawnByOS()On macOS with apple.laf.useScreenMenuBar=true the menu bar is drawn
by the OS rather than FlatLaf, so menu-item icons need to track the OS
appearance instead of the app theme to stay legible. |
|
static boolean |
isSystemDarkMode() |
|
static boolean |
isUsingCustomTheme()True iff the theme currently in use is loaded from a user-supplied file. |
|
static void |
notifyThemeChanged() |
|
static Map |
parseTheme(Reader reader)Parses a .theme file (java.util.Properties format with our value sub-syntax) into a structured theme: { inputBackground, outputBackground, styles: name→attrs }. |
|
static boolean |
refreshSystemDarkMode()Re-probe OS appearance, update the cache, and report whether it changed. |
|
static void |
reloadThemes()Clear the parsed-theme cache so next lookup re-reads from disk/classpath. |
|
static void |
removeThemeChangeListener(Runnable listener) |
|
static void |
setCustomDarkPath(String path) |
|
static void |
setCustomLightPath(String path) |
Foreground color for menu-item icons — OS-tinted on the mac screen menu bar, app-tinted otherwise.
Returns the attributes for a single theme style key as a plain map (foreground/background Colors plus bold/italic/underline Booleans). Consumed by SmartDocumentFilter so ANTLR-token-driven highlighting picks up the same theme values as the regex-based GroovyFilter styles. Returns an empty map if the theme doesn't define the key.
True iff menu-item icons will paint against a dark background.
On macOS with apple.laf.useScreenMenuBar=true the menu bar is drawn
by the OS rather than FlatLaf, so menu-item icons need to track the OS
appearance instead of the app theme to stay legible.
True iff the theme currently in use is loaded from a user-supplied file.
Parses a .theme file (java.util.Properties format with our value sub-syntax) into a structured theme: { inputBackground, outputBackground, styles: name→attrs }. Each attrs map may contain foreground/background Colors and bold/italic/underline flags. Unknown keys are silently ignored so theme files stay forward-compatible.
Re-probe OS appearance, update the cache, and report whether it changed.
Clear the parsed-theme cache so next lookup re-reads from disk/classpath.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.