[]
        
(Showing Draft Content)

ITheme

Interface ITheme

All Known Implementing Classes:
Theme

public interface ITheme
Contains the theme information.

An ITheme describes a workbook theme, including its name, whether it is built in, and the associated IThemeColorScheme and IThemeFontScheme.


 ITheme theme = new Theme("Custom Theme", Themes.GetBerlin());
 String name = theme.getName();
 boolean builtIn = theme.isBuiltIn();
 IThemeColorScheme colorScheme = theme.getThemeColorScheme();
 IThemeFontScheme fontScheme = theme.getThemeFontScheme();
 
  • Method Details

    • getName

      String getName()
      Gets the name of the theme.

      The returned name identifies the current theme and can be used to look up a theme from the Themes collection.

      
       ITheme theme = Themes.GetBerlin();
       String name = theme.getName();
       
      Returns:
      The name of the theme.
    • isBuiltIn

      boolean isBuiltIn()
      Gets whether the theme is a built-in theme.

      Built-in themes are the predefined themes returned by the Themes utility methods. Custom themes created programmatically return false.

      
       ITheme theme = Themes.GetBerlin();
       boolean builtIn = theme.isBuiltIn();
       
      Returns:
      true if the theme is a built-in theme; otherwise, false.
    • getThemeColorScheme

      IThemeColorScheme getThemeColorScheme()
      Gets the color scheme within the theme.

      Represents a color scheme within the theme and provides access to the theme colors by IThemeColor.

      
       ITheme theme = workbook.getTheme();
       IThemeColorScheme colorScheme = theme.getThemeColorScheme();
       IThemeColor accent1 = colorScheme.get(ThemeColor.Accent1);
       
      Returns:
      The color scheme within the theme.
    • getThemeFontScheme

      IThemeFontScheme getThemeFontScheme()
      Gets the font scheme within the theme.

      Represents the theme font scheme and provides access to the major and minor theme font collections through IThemeFontScheme.getMajor() and IThemeFontScheme.getMinor().

      
       ITheme theme = Themes.GetBerlin();
       IThemeFontScheme fontScheme = theme.getThemeFontScheme();
       IThemeFonts majorFonts = fontScheme.getMajor();
       
      Returns:
      The font scheme within the theme.