Package docking.theme.gui
Class ThemeUtils
java.lang.Object
docking.theme.gui.ThemeUtils
Some common methods related to saving themes. These are invoked from various places to handle
what to do if a change is made that would result in loosing theme changes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
askToSaveThemeChanges
(ThemeManager themeManager) Asks the user if they want to save the current theme changes.static Boolean
canSaveToName
(ThemeManager themeManager, String name) static void
deleteTheme
(ThemeManager themeManager) Prompts for and deletes a selected theme.static void
exportTheme
(ThemeManager themeManager) Exports a theme, prompting the user to pick an file.static File
getSaveFile
(String themeName) static void
importTheme
(ThemeManager themeManager) Imports a theme.static boolean
saveThemeChanges
(ThemeManager themeManager) Saves all current theme changes.
-
Constructor Details
-
ThemeUtils
public ThemeUtils()
-
-
Method Details
-
askToSaveThemeChanges
Asks the user if they want to save the current theme changes. If they answer yes, it will handle several use cases such as whether it gets saved to a new file or overwrites an existing file.- Parameters:
themeManager
- the theme manager- Returns:
- true if the operation was not cancelled
-
saveThemeChanges
Saves all current theme changes. Handles several use cases such as requesting a new theme name and asking to overwrite an existing file.- Parameters:
themeManager
- the theme manager- Returns:
- true if the operation was not cancelled
-
importTheme
Imports a theme. Handles the case where there are existing changes to the current theme.- Parameters:
themeManager
- the application ThemeManager
-
exportTheme
Exports a theme, prompting the user to pick an file. Also handles dealing with any existing changes to the current theme.- Parameters:
themeManager
- the ThemeManager that actually does the export
-
deleteTheme
Prompts for and deletes a selected theme.- Parameters:
themeManager
- the theme manager
-
canSaveToName
-
getSaveFile
-