public class ResponsiveThemeRegistry extends DesktopThemeRegistry
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TABLET_PREFIX |
Constructor and Description |
---|
ResponsiveThemeRegistry()
Initialize the registry with a default tablet theme
|
Modifier and Type | Method and Description |
---|---|
boolean |
deregister(Theme theme)
Removes a desktop or a tablet theme from registry
Tablet themes must be identified with the "tablet:" prefix.
|
Theme |
getTheme(java.lang.String themeName)
Returns the registered device-specific theme; null if not found in registry
|
Theme[] |
getThemes()
Returns the available themes, responsive to the users' device
|
boolean |
hasTheme(java.lang.String themeName)
Checks if a certain theme is registered.
|
boolean |
register(Theme theme)
Registers a desktop or a tablet theme
Tablet themes must be identified with the "tablet:" prefix.
|
public static final java.lang.String TABLET_PREFIX
public ResponsiveThemeRegistry()
public boolean register(Theme theme)
register
in interface ThemeRegistry
register
in class DesktopThemeRegistry
theme
- the Theme to be registered. For tablet themes,
theme.getName() should have the prefix "tablet:". The tablet
theme would be registered with the prefix removed.public boolean deregister(Theme theme)
Tablet themes must be identified with the "tablet:" prefix.
deregister
in interface ThemeRegistry
deregister
in class DesktopThemeRegistry
theme
- the theme to be removed. For tablet
themes, theme should have its name prepended with the prefix
"tablet:" before calling. For example, use the sequence below
to deregister a tablet theme.
Theme tabletTheme = new StandardTheme("tablet:dark");
themeRegistry.deregister(tabletTheme);
public Theme[] getThemes()
getThemes
in interface ThemeRegistry
getThemes
in class DesktopThemeRegistry
public boolean hasTheme(java.lang.String themeName)
hasTheme
in interface ThemeRegistry
hasTheme
in class DesktopThemeRegistry
themeName
- the name of the theme to checkpublic Theme getTheme(java.lang.String themeName)
getTheme
in interface ThemeRegistry
getTheme
in class DesktopThemeRegistry
themeName
- the name of the theme to retrieveCopyright © 2005-2021 Potix Corporation. All Rights Reserved.