Package org.opencms.gwt.shared
Class CmsTemplateContextInfo
java.lang.Object
org.opencms.gwt.shared.CmsTemplateContextInfo
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsTemplateContextInfo
extends Object
implements com.google.gwt.user.client.rpc.IsSerializable
Client-compatible bean with information about the current template context.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the map of forbidden contexts for resource types.getClientVariants
(String context) Gets the client variant information for a specific context.Gets the map of labels for the different template contexts.Gets the name of the context provider class.Gets the name of the cookie used for overriding the template context.Gets the key of the currently active template context.Gets the default label.Gets the custom context menu entry label (if null, the default is used).Gets the key of the currently selected template context, using the cookie.Gets the property definition for the templateContexts setting.boolean
hasClientVariants
(String context) Checks if client variants for the given context are present.void
setAllowedContexts
(Map<String, CmsDefaultSet<String>> allowedContextMap) Sets the allowed contexts.void
setClientVariant
(String context, String variant, CmsClientVariantInfo info) Adds a client variant.void
setContextLabels
(Map<String, String> contextLabels) Sets the map of labels for the contexts.void
setContextProvider
(String contextProvider) Sets the context provider class name.void
setCookieName
(String cookieName) Sets the name of the cookie used for overriding the template context.void
setCurrentContext
(String context) Sets the active context.void
setDefaultLabel
(String defaultLabel) Sets the default label.void
setMenuLabel
(String label) Sets the custom context menu entry label.void
setSelectedContext
(String selectedContext) Sets the selected context.void
setSettingDefinition
(CmsXmlContentProperty definition) Sets the property definition for the templateContexts setting.void
setShouldShowElementTemplateContextSelection
(boolean newValue) Enables / disables display of the template context select options in the settings dialog.boolean
Returns true if the template context selection should be shown for container elements.boolean
Returns true if the template context selection context menu entry should be shown.
-
Field Details
-
DUMMY_ELEMENT_MARKER
Dummy element marker class.- See Also:
-
EMPTY_VALUE
The constant used for empty setting.- See Also:
-
SETTING
The setting name used for storing the compatible template contexts.- See Also:
-
-
Constructor Details
-
CmsTemplateContextInfo
public CmsTemplateContextInfo()Default constructor.
-
-
Method Details
-
getAllowedContexts
Gets the map of forbidden contexts for resource types.- Returns:
- the map of forbidden contexts for resource types
-
getClientVariants
Gets the client variant information for a specific context.- Parameters:
context
- the context name- Returns:
- the client variant information for that context
-
getContextLabels
Gets the map of labels for the different template contexts.- Returns:
- the map of template context labels
-
getContextProvider
Gets the name of the context provider class.- Returns:
- the name of the context provider class
-
getCookieName
Gets the name of the cookie used for overriding the template context.- Returns:
- the cookie name
-
getCurrentContext
Gets the key of the currently active template context.- Returns:
- the key of the currently active template context
-
getDefaultLabel
Gets the default label.- Returns:
- the default label
-
getMenuLabel
Gets the custom context menu entry label (if null, the default is used).- Returns:
- the custom context menu entry label
-
getSelectedContext
Gets the key of the currently selected template context, using the cookie.- Returns:
- the name of the currently selected template context
-
getSettingDefinition
Gets the property definition for the templateContexts setting.- Returns:
- the property definition for the templateContexts setting
-
hasClientVariants
Checks if client variants for the given context are present.- Parameters:
context
- a context name- Returns:
- true if there are client variants for the context
-
setAllowedContexts
Sets the allowed contexts.- Parameters:
allowedContextMap
- the map of allowed contexts
-
setContextLabels
Sets the map of labels for the contexts.- Parameters:
contextLabels
- the map of context labels
-
setContextProvider
Sets the context provider class name.- Parameters:
contextProvider
- the context provider class name
-
setCookieName
Sets the name of the cookie used for overriding the template context.- Parameters:
cookieName
- the name of the cookie used for overriding the template context
-
setCurrentContext
Sets the active context.- Parameters:
context
- the active context
-
setDefaultLabel
Sets the default label.- Parameters:
defaultLabel
- the default label
-
setMenuLabel
Sets the custom context menu entry label.- Parameters:
label
- the custom context menu entry label
-
setSelectedContext
Sets the selected context.- Parameters:
selectedContext
- the selected context
-
setSettingDefinition
Sets the property definition for the templateContexts setting.- Parameters:
definition
- the property definition
-
setShouldShowElementTemplateContextSelection
Enables / disables display of the template context select options in the settings dialog.- Parameters:
newValue
- if true, show the select options
-
shouldShowElementTemplateContextSelection
Returns true if the template context selection should be shown for container elements.- Returns:
- true if the template context selection for elements should be shown
-
shouldShowTemplateContextContextMenuEntry
Returns true if the template context selection context menu entry should be shown.- Returns:
- true if the template context selection context menu entry should be shown
-