Class ThemeUtils

java.lang.Object
docking.theme.gui.ThemeUtils

public class ThemeUtils extends Object
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 Details

    • ThemeUtils

      public ThemeUtils()
  • Method Details

    • askToSaveThemeChanges

      public static boolean askToSaveThemeChanges(ThemeManager themeManager)
      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

      public static boolean saveThemeChanges(ThemeManager themeManager)
      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

      public static void importTheme(ThemeManager themeManager)
      Imports a theme. Handles the case where there are existing changes to the current theme.
      Parameters:
      themeManager - the application ThemeManager
    • exportTheme

      public static void exportTheme(ThemeManager themeManager)
      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

      public static void deleteTheme(ThemeManager themeManager)
      Prompts for and deletes a selected theme.
      Parameters:
      themeManager - the theme manager
    • canSaveToName

      public static Boolean canSaveToName(ThemeManager themeManager, String name)
    • getSaveFile

      public static File getSaveFile(String themeName)