Modifier and Type | Field and Description |
---|---|
static Theme |
INITIAL_THEME |
static Theme |
MATERIAL_DARK |
static Theme |
MATERIAL_LIGHT |
static Theme |
MIDNIGHT |
Constructor and Description |
---|
Themes(Theme... initial)
Creates a new theme registry.
|
Modifier and Type | Method and Description |
---|---|
Theme |
forName(java.lang.String name)
Gets the theme with the given name.
|
static Themes |
getDefault()
Gets the default themes instance.
|
javafx.collections.ObservableList<Theme> |
getThemes()
Gets an observable list of the registered themes.
|
void |
loadThemesFromDir()
Loads and registers all themes from the
themes directory . |
void |
register(Theme theme)
Registers an item with this registry.
|
void |
unregister(Theme theme)
Unregisters an item from this registry.
|
addItem, getItems, isRegistered, registerAll, registerAll, registerIfAbsent, removeItem, unregisterAll, unregisterAll
public static final Theme MATERIAL_LIGHT
public static final Theme MATERIAL_DARK
public static final Theme MIDNIGHT
public static final Theme INITIAL_THEME
public Themes(Theme... initial)
initial
- the initial themespublic static Themes getDefault()
public Theme forName(java.lang.String name)
INITIAL_THEME
instead.name
- the name of the theme to getpublic void register(Theme theme)
Registry
unregistered
.public void unregister(Theme theme)
Registry
unregister
in class Registry<Theme>
theme
- the item to unregisterpublic javafx.collections.ObservableList<Theme> getThemes()
public void loadThemesFromDir() throws java.io.IOException
themes directory
.java.io.IOException
- if the themes directory does not exist and could not be createdjava.io.IOException
- if the themes directory exists but could not be read from