|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bowstreet.webapp.Theme
public class Theme
Utility class used to access WebApp Theme property values.
This class is typically used by Builders developers that want to use the Theme property information to influence their UI.
The following are the typical steps:
1) Add a "UseTheme" boolean builder input to give the user the option of using the theme vs. directly setting the builder inputs.
2) In the builder regen code check the UseTheme status to determine if a theme property should be used or the original builder input.
3) If "UseTheme" is enabled then call the Theme.getString(..) method to fetch the property value from the theme.
4) If the builder wants to provide override properties for a given instance of the builder, then it should publish the property name(s) using the Theme.addThemeOverride(..) method.
getString(WebApp, String, String, String)
Field Summary | |
---|---|
static java.lang.String |
BOWSTREET_THEME_OVERRIDES
|
static java.lang.String |
THEME_FILE_KEY
|
static java.lang.String |
WEBAPP_THEME_PROPERTY
|
Method Summary | |
---|---|
static void |
addThemeOverride(WebApp webApp,
java.lang.String overridePrefix,
java.lang.String key)
Adds the specified theme property name to the list of overrides on the WebApp. |
static boolean |
getBoolean(WebApp webApp,
java.lang.String overridePrefix,
java.lang.String key,
boolean defaultValue)
Gets the theme property value from the current WebApp theme. |
java.util.List |
getNames()
Gets a list of the property names. |
java.lang.String |
getString(java.lang.String key)
Gets the String value of the specified property key. |
static java.lang.String |
getString(WebApp webApp,
java.lang.String key)
Gets the theme property value from the current WebApp theme. |
static java.lang.String |
getString(WebApp webApp,
java.lang.String key,
java.lang.String defaultValue)
Gets the theme property value from the current WebApp theme. |
static java.lang.String |
getString(WebApp webApp,
java.lang.String overridePrefix,
java.lang.String key,
java.lang.String defaultValue)
Gets the theme property value from the current WebApp theme. |
boolean |
isDefault()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BOWSTREET_THEME_OVERRIDES
public static final java.lang.String THEME_FILE_KEY
public static final java.lang.String WEBAPP_THEME_PROPERTY
Method Detail |
---|
public static void addThemeOverride(WebApp webApp, java.lang.String overridePrefix, java.lang.String key)
webApp
- The WebApp to add the override to.overridePrefix
- The name of the override prefix (e.g. orders).key
- The theme property (e.g. ViewAndForm_InputPageBase).public static boolean getBoolean(WebApp webApp, java.lang.String overridePrefix, java.lang.String key, boolean defaultValue)
webApp
- The current WebApp or null to access global theme.overridePrefix
- A prefix used to build override key(e.g. orders)..key
- The property name (e.g. ViewAndForm_InputPageBase).defaultValue
- the value to use if there is no Theme property found.
public java.util.List getNames()
PropertyAccess
getNames
in interface PropertyAccess
public java.lang.String getString(java.lang.String key)
PropertyAccess
getString
in interface PropertyAccess
key
- The key to get the property for.
public static java.lang.String getString(WebApp webApp, java.lang.String key)
webApp
- The current WebApp or null to access global theme.key
- The property name (e.g. ViewAndForm_InputPageBase).
public static java.lang.String getString(WebApp webApp, java.lang.String key, java.lang.String defaultValue)
webApp
- The current WebApp or null to access global theme.key
- The property name (e.g. ViewAndForm_InputPageBase).defaultValue
- The value to use if there is no Theme property found.
public static java.lang.String getString(WebApp webApp, java.lang.String overridePrefix, java.lang.String key, java.lang.String defaultValue)
webApp
- The current WebApp or null to access global theme.overridePrefix
- A prefix used to build override key(e.g. orders)..key
- The property name (e.g. ViewAndForm_InputPageBase).defaultValue
- the value to use if there is no Theme property found.
public static final String MY_SAMPLE_BUILDER_FORM_BASE = "MySampleBuilder_PageBase"; public void doBuilderCall(GenContext genContext, WebApp webApp, BuilderCall builderCall, BuilderInputs builderInputs) { ..... String name = builderInputs.getString(Constants.Name, null); String inputPageURL = builderInputs.getString(Constants.InputPageURL, null); boolean useTheme = builderInputs.getBoolean(Constants.UseTheme, false); ..... ..... // if theme is enabled then override input value with the ones from the Theme if(useTheme) { inputPageURL = Theme.getString(webApp, name, MY_SAMPLE_BUILDER_FORM_BASE, inputPageURL); // publish the names for use at designtime in the Theme builder if(genContext.isDesignTime()) { Theme.addThemeOverride(webApp, name, MY_SAMPLE_BUILDER_FORM_BASE); } } ..... ..... }
public boolean isDefault()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |