Package de.xima.fc.form.common.models
Enum EFormThemeResourceContext
- java.lang.Object
-
- java.lang.Enum<EFormThemeResourceContext>
-
- de.xima.fc.form.common.models.EFormThemeResourceContext
-
- All Implemented Interfaces:
Serializable
,Comparable<EFormThemeResourceContext>
public enum EFormThemeResourceContext extends Enum<EFormThemeResourceContext>
Common resource contexts for form themes, seeIFormTheme
. The context is a string to allow for plugins to define different contexts. This enumeration lists all common resource contexts known to the system.Describes the context in which a resource from a form theme is used. Each form theme may provide different resources for different contexts. For example, a form theme might provide a different CSS file for the web form and for HTML templates.
- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
-
Enum Constant Summary
Enum Constants Enum Constant Description HTML_TEMPLATE
Context for resources that are included in HTML templates, such as the success page returned by the workflow when the form was submitted successfully.RESOURCE
Context for dependent resources.WEB_FORM
Context for resources that are included in the rendered web form, e.g.
-
Field Summary
Fields Modifier and Type Field Description static String
NAME_HTML_TEMPLATE
ThegetContextName()
of theHTML_TEMPLATE
context as a compile-time constant so that it can be used e.g.static String
NAME_RESOURCE
ThegetContextName()
of theRESOURCE
context as a compile-time constant so that it can be used e.g.static String
NAME_WEB_FORM
ThegetContextName()
of theWEB_FORM
context as a compile-time constant so that it can be used e.g.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static EFormThemeResourceContext
byContextNameOrNull(String contextName)
Gets the enum constant of the resource context with the given name, or null if no such context exists.abstract String
getContextName()
Gets the name of this resource context, i.e.static EFormThemeResourceContext
valueOf(String name)
Returns the enum constant of this type with the specified name.static EFormThemeResourceContext[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HTML_TEMPLATE
public static final EFormThemeResourceContext HTML_TEMPLATE
Context for resources that are included in HTML templates, such as the success page returned by the workflow when the form was submitted successfully. These are usually CSS and JavaScript files.
-
RESOURCE
public static final EFormThemeResourceContext RESOURCE
Context for dependent resources. Such resources are not included directly, but are referenced by other resources. For example, a CSS file may reference images, fonts, or other CSS resources.
-
WEB_FORM
public static final EFormThemeResourceContext WEB_FORM
Context for resources that are included in the rendered web form, e.g. when a form is opened via/form/provide/ID
or/form/review/ID
. These are usually CSS and JavaScript files.
-
-
Field Detail
-
NAME_RESOURCE
public static final String NAME_RESOURCE
ThegetContextName()
of theRESOURCE
context as a compile-time constant so that it can be used e.g. in switch expressions or statements.- See Also:
- Constant Field Values
-
NAME_HTML_TEMPLATE
public static final String NAME_HTML_TEMPLATE
ThegetContextName()
of theHTML_TEMPLATE
context as a compile-time constant so that it can be used e.g. in switch expressions or statements.- See Also:
- Constant Field Values
-
NAME_WEB_FORM
public static final String NAME_WEB_FORM
ThegetContextName()
of theWEB_FORM
context as a compile-time constant so that it can be used e.g. in switch expressions or statements.- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static EFormThemeResourceContext[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EFormThemeResourceContext c : EFormThemeResourceContext.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EFormThemeResourceContext valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getContextName
public abstract String getContextName()
Gets the name of this resource context, i.e. the string representation of this context used byIFormTheme
.- Returns:
- The name of this resource context.
-
byContextNameOrNull
public static EFormThemeResourceContext byContextNameOrNull(String contextName)
Gets the enum constant of the resource context with the given name, or null if no such context exists.- Parameters:
contextName
- The name of the context to get.- Returns:
- The enum constant with the given name, or null if no such context exists.
-
-