@DefaultNonNull public class FragmentedThemeFactory extends Object
This theme factory uses fragments to create a "theme". A DomUI theme consists of the following:
A theme is identified by 4 strings, one for each components: a style name, a iconset name, a color name and a variant name. The full theme is then described as a string: style/iconset/color/variant. An example theme instance is: "domui/domui/orange/default". This four-part string is the theme name. This factory is used to instantiate a theme instance for a specific "theme name".
.The first three parts of the theme name come from an application-level global setting: the string set as DomApplication.setCurrentTheme(String).
This defines the "global" theme for the application. The last part, the variant, is provided by the page itself: it allows a page to specify a different
version for the master stylesheet. The use case for this is migration to different style sheets if an older one has problems; by creating pages that
refer to a new sheet we can change the stylesheet without regression risk for existing pages.
The different parts of the theme are constructed as follows:
A style can 'inherit' another style. This is done in each style's ".jsprops" file where the file must start with an "inherit('xxxx')" statement.
| Modifier | Constructor and Description |
|---|---|
protected |
FragmentedThemeFactory(DomApplication da,
String themeName)
Constructor for a factory instance that will generate the ITheme.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
collectFragments(List<String> directoryStack,
String suffix) |
protected ITheme |
createTheme()
Instance creation.
|
protected RhinoExecutor |
executor()
Get the shared executor and scope.
|
protected IResourceRef |
findRef(IResourceDependencyList rdl,
String rurl) |
protected DomApplication |
getApplication() |
protected ResourceDependencyList |
getCurrentDependencies() |
static IThemeFactory |
getInstance() |
protected List<String> |
getSearchList() |
protected String |
getStylesheet() |
protected String |
getThemeName() |
void |
internalInheritColor(String colorName)
Load color properties.
|
void |
internalInheritIcon(String iconName)
Load the icon set specified.
|
void |
internalInheritStyle(String styleName) |
protected void |
loadClear()
Initialize for loading a new set.
|
protected void |
loadColors(String colorName)
Load everything related to colors.
|
protected void |
loadIcons(String iconName,
String variant)
Load all icon related info.
|
protected void |
loadStyle(String styleName,
String variant)
Load all theme style (css) related info.
|
protected void |
loadStyleInfo() |
protected FragmentedThemeFactory(DomApplication da, String themeName)
da - themeName - public static IThemeFactory getInstance()
@Nonnull protected RhinoExecutor executor() throws Exception
Exceptionprotected ITheme createTheme() throws Exception
Exceptionprotected void loadStyle(String styleName, String variant) throws Exception
styleName - variant - Exceptionpublic void internalInheritStyle(String styleName) throws Exception
Exceptionprotected void loadIcons(String iconName, String variant) throws Exception
Icon sets consist of a set of property file fragments too.
variant - iconName - Exceptionpublic void internalInheritIcon(String iconName) throws Exception
iconName - Exceptionprotected void loadColors(String colorName) throws Exception
IScriptScope being
filled with all color properties.colorName - Exceptionpublic void internalInheritColor(String colorName) throws Exception
colorName - Exceptionprotected ResourceDependencyList getCurrentDependencies()
protected void loadClear()
@Nullable protected IResourceRef findRef(@Nonnull IResourceDependencyList rdl, @Nonnull String rurl) throws Exception
Exceptionpublic List<String> collectFragments(List<String> directoryStack, String suffix) throws Exception
Exceptionprotected String getThemeName()
protected DomApplication getApplication()
Copyright © 2017 etc.to. All rights reserved.