public class ThemeStylingServiceImpl extends DefaultComponent implements ThemeStylingService
ThemeStylingServiceThemeStylingService.PRESET_CATEGORY| Modifier and Type | Field and Description |
|---|---|
protected FlavorRegistry |
flavorReg |
protected PageRegistry |
pageReg |
protected ResourceRegistry |
resourceReg |
protected StyleRegistry |
styleReg |
lastModifiedFLAVOR_MARKER, PAGE_STYLE_CLASS_NAME_PREFIX, PAGE_STYLE_NAME_SUFFIX| Constructor and Description |
|---|
ThemeStylingServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ComponentContext context) |
protected Logo |
computeLogo(Flavor flavor,
List<String> flavors) |
protected PalettePreview |
computePalettePreview(Flavor flavor,
List<String> flavors) |
protected List<FlavorPresets> |
computePresets(Flavor flavor,
List<String> flavors) |
String |
getDefaultFlavorName(String themePageName)
Returns the default flavor for a given theme page
|
Flavor |
getFlavor(String flavorName)
Returns the flavor for given name, or null if not found.
|
List<String> |
getFlavorNames(String themePageName)
Returns the flavor names for a given theme page
|
List<Flavor> |
getFlavors(String themePageName)
Returns the flavors for a given theme page
|
Logo |
getLogo(String flavorName)
Returns the logo configured for given flavor name, and fallbacks on the
extends flavor logo if not set.
|
protected String |
getPaletteName(String name,
String category) |
protected URL |
getUrlFromPath(String path,
RuntimeContext extensionContext) |
protected void |
postRegisterAllThemePageResources()
Reload theme page resources conf according to new style
|
protected void |
postRegisterThemePageResources(String themePageName,
ThemePage page,
ThemePage pageApplyingToAll) |
protected void |
postRegisterThemePageResources(ThemePage page)
Register link between page and style after theme has been registered
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
protected void |
registerFlavor(Flavor flavor,
RuntimeContext extensionContext) |
protected void |
registerFlavorToThemeService(Flavor flavor,
RuntimeContext extensionContext) |
protected void |
registerPage(ThemePage themePage) |
protected void |
registerResource(ResourceType resource,
RuntimeContext extensionContext) |
protected void |
registerStyle(SimpleStyle style,
RuntimeContext extensionContext) |
void |
themeGlobalResourcesRegistered(URL themeUrl)
Hook to notify the service that global resources for a theme need to be
registered
|
void |
themeRegistered(String themeName)
Hook to notify the service that a theme has been registered
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
protected void |
unregisterFlavorToThemeService(Flavor flavor) |
protected void |
unregisterResourceToThemeService(ResourceType resource) |
protected void |
unRegisterThemePageResources(String themePageName,
ThemePage page) |
protected void |
unRegisterThemePageResources(ThemePage page) |
applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtensionprotected PageRegistry pageReg
protected FlavorRegistry flavorReg
protected StyleRegistry styleReg
protected ResourceRegistry resourceReg
public void activate(ComponentContext context) throws Exception
activate in interface Componentactivate in class DefaultComponentExceptionpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution in class DefaultComponentExceptionpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution in class DefaultComponentExceptionprotected void registerFlavor(Flavor flavor, RuntimeContext extensionContext) throws Exception
Exceptionprotected List<FlavorPresets> computePresets(Flavor flavor, List<String> flavors)
protected void registerFlavorToThemeService(Flavor flavor, RuntimeContext extensionContext)
protected void unregisterFlavorToThemeService(Flavor flavor)
protected void registerResource(ResourceType resource, RuntimeContext extensionContext) throws Exception
Exceptionprotected void unregisterResourceToThemeService(ResourceType resource)
protected void registerStyle(SimpleStyle style, RuntimeContext extensionContext) throws Exception
Exceptionprotected URL getUrlFromPath(String path, RuntimeContext extensionContext)
protected void postRegisterAllThemePageResources()
protected void postRegisterThemePageResources(ThemePage page) throws ThemeException
ThemeExceptionprotected void postRegisterThemePageResources(String themePageName, ThemePage page, ThemePage pageApplyingToAll) throws ThemeException
ThemeExceptionprotected void unRegisterThemePageResources(ThemePage page) throws ThemeException
ThemeExceptionprotected void unRegisterThemePageResources(String themePageName, ThemePage page) throws ThemeException
ThemeExceptionpublic String getDefaultFlavorName(String themePageName)
ThemeStylingServicegetDefaultFlavorName in interface ThemeStylingServicepublic Flavor getFlavor(String flavorName)
ThemeStylingService
If not defined on the local flavor, flavor attributes will be resolved
from the extended flavor if any (except presets that just need to be
resolved at registration to the ThemeService.
getFlavor in interface ThemeStylingServicepublic Logo getLogo(String flavorName)
ThemeStylingServicegetLogo in interface ThemeStylingServiceprotected PalettePreview computePalettePreview(Flavor flavor, List<String> flavors)
public List<String> getFlavorNames(String themePageName)
ThemeStylingServicegetFlavorNames in interface ThemeStylingServicepublic List<Flavor> getFlavors(String themePageName)
ThemeStylingServicegetFlavors in interface ThemeStylingServicepublic void themeRegistered(String themeName)
ThemeStylingServicethemeRegistered in interface ThemeStylingServicepublic void themeGlobalResourcesRegistered(URL themeUrl)
ThemeStylingServicethemeGlobalResourcesRegistered in interface ThemeStylingServiceCopyright © 2020 Chalmers University. All rights reserved.