Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.theme

public final Enum ThemePreset

extends Enum<ThemePreset>
Class Inheritance
Annotations
@org.jabref.architecture.AllowedToUseClassGetResource
Imports
java.net.URL, java.util.Objects, .Optional, org.jabref.architecture.AllowedToUseClassGetResource, org.jabref.logic.l10n.Localization, org.jspecify.annotations.Nullable

A theme the user can select. Every theme, JabRef's own included, is maintained on https://themes.jabref.org/ and bundled by the build from the jabgui/src/main/themes.jabref.org submodule (see processResources in jabgui/build.gradle.kts); the JabRef repository holds no theme of its own, only the base stylesheet that reads the tokens.

The constants are a hand-maintained mirror of that submodule -- ThemePresetTest fails when the two drift apart -- so that the set of themes is fixed at compile time and no classpath scanning happens at startup. The JabRef and Primer themes declare the complete -color-* token contract and have no parent; the other themes only override what differs from their getParent(), the JabRef theme, which ThemeManager installs beneath them.

impl->req~ux.themes.bundled-community-themes~1

Field Summary

Modifier and TypeField and Description
private final String
public static final ThemePreset
private final String
private final String
public static final ThemePreset
public static final ThemePreset
public static final ThemePreset
public static final ThemePreset
public static final ThemePreset
public static final ThemePreset
public static final ThemePreset
public static final ThemePreset
public static final ThemePreset
private final String
public static final ThemePreset
public static final ThemePreset
private final @Nullable ThemePreset
public static final ThemePreset
private StyleSheet

Constructor Summary

AccessConstructor and Description
private
ThemePreset(String themeName, String css, @Nullable ThemePreset
the theme this one only overrides tokens of, null for a theme declaring the complete token contract
parent
)

private
ThemePreset(String collection, String darkHue, String lightHue, String css, @Nullable ThemePreset parent)

Dino Girl published her dark and light hues as separate themes; the port pairs each dark hue with the closest light one in a single file, so such a theme carries one name per color scheme.

Method Summary

Modifier and TypeMethod and Description
public String
getLocalizedName()

Both names of a paired theme, e.g. for lists that are not tied to a color scheme.

public String
getLocalizedName(@Nullable ThemeColorScheme
the scheme the theme is shown in; an unset one is read as ThemeColorScheme#FOLLOW_SYSTEM, as everywhere else
colorScheme
)

The name matching the color scheme the user would see the theme in; when following the system, both hues are shown as "dark / light".

public Optional<ThemePreset>
getParent()

The theme whose stylesheet is installed beneath this one, so that the tokens this theme does not declare come from there.

public String
public Optional<URL>
getPreview(ThemeColorScheme colorScheme)

The bundled screenshot of this theme in the given color scheme, scaled to preview size by the build (generateThemePreviews in jabgui/build.gradle.kts).

public StyleSheet
public static ThemePreset
of(String themePreset)

public static ThemePreset
public static ThemePreset[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

bothNamesback to summary
private final String bothNames
CHOCOLATE_HONEYback to summary
public static final ThemePreset CHOCOLATE_HONEY
cssback to summary
private final String css
darkNameback to summary
private final String darkName
DINOGIRLS_CHOCOLATEBROWNback to summary
public static final ThemePreset DINOGIRLS_CHOCOLATEBROWN
DINOGIRLS_FUCHSIAPURPLEback to summary
public static final ThemePreset DINOGIRLS_FUCHSIAPURPLE
DINOGIRLS_LIGHTBLUEback to summary
public static final ThemePreset DINOGIRLS_LIGHTBLUE
DINOGIRLS_LIGHTSEAGREENback to summary
public static final ThemePreset DINOGIRLS_LIGHTSEAGREEN
DINOGIRLS_PREHISTORICAMBERback to summary
public static final ThemePreset DINOGIRLS_PREHISTORICAMBER
DINOGIRLS_TWILIGHTLAVENDERback to summary
public static final ThemePreset DINOGIRLS_TWILIGHTLAVENDER
DINOGIRLS_WINEREDback to summary
public static final ThemePreset DINOGIRLS_WINERED
EVERFORESTback to summary
public static final ThemePreset EVERFOREST
JABREFback to summary
public static final ThemePreset JABREF
lightNameback to summary
private final String lightName
NORDback to summary
public static final ThemePreset NORD
PAPERSback to summary
public static final ThemePreset PAPERS
parentback to summary
private final @Nullable ThemePreset parent
PRIMERback to summary
public static final ThemePreset PRIMER
styleSheetback to summary
private StyleSheet styleSheet

Constructor Detail

ThemePresetback to summary
private ThemePreset(String themeName, String css, @Nullable ThemePreset parent)
Parameters
parent:@Nullable ThemePreset

the theme this one only overrides tokens of, null for a theme declaring the complete token contract

ThemePresetback to summary
private ThemePreset(String collection, String darkHue, String lightHue, String css, @Nullable ThemePreset parent)

Dino Girl published her dark and light hues as separate themes; the port pairs each dark hue with the closest light one in a single file, so such a theme carries one name per color scheme. Community theme names are proper nouns and stay untranslated.

Method Detail

getLocalizedNameback to summary
public String getLocalizedName()

Both names of a paired theme, e.g. for lists that are not tied to a color scheme.

getLocalizedNameback to summary
public String getLocalizedName(@Nullable ThemeColorScheme colorScheme)

The name matching the color scheme the user would see the theme in; when following the system, both hues are shown as "dark / light".

Parameters
colorScheme:@Nullable ThemeColorScheme

the scheme the theme is shown in; an unset one is read as ThemeColorScheme#FOLLOW_SYSTEM, as everywhere else

getParentback to summary
public Optional<ThemePreset> getParent()

The theme whose stylesheet is installed beneath this one, so that the tokens this theme does not declare come from there. Empty for the JabRef and Primer themes, which declare every token.

getPreferenceNameback to summary
public String getPreferenceName()
getPreviewback to summary
public Optional<URL> getPreview(ThemeColorScheme colorScheme)

The bundled screenshot of this theme in the given color scheme, scaled to preview size by the build (generateThemePreviews in jabgui/build.gradle.kts). Following the system yields the dark one.

getStyleSheetback to summary
public StyleSheet getStyleSheet()
ofback to summary
public static ThemePreset of(String themePreset)
valueOfback to summary
public static ThemePreset valueOf(String name)
valuesback to summary
public static ThemePreset[] values()