Package org.opencms.ade.galleries.shared
Class CmsGalleryTabConfiguration
- java.lang.Object
-
- org.opencms.ade.galleries.shared.CmsGalleryTabConfiguration
-
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsGalleryTabConfiguration extends java.lang.Object implements com.google.gwt.user.client.rpc.IsSerializable
A bean containing a configuration for the gallery dialog's available tabs, consisting of a list of tabs and a default tab to display first.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,CmsGalleryTabConfiguration>
DEFAULT_CONFIGURATIONS
The map containing the predefined tab configurations.protected I_CmsGalleryProviderConstants.GalleryTabId
m_defaultTab
The id of the default tab.static java.lang.String
TC_ADE_ADD
Gallery configuration id.static java.lang.String
TC_FOLDERS
Gallery configuration id.static java.lang.String
TC_GALLERIES
Gallery configuration id.static java.lang.String
TC_SELECT_ALL
Gallery configuration id.static java.lang.String
TC_SELECT_ALL_NO_SITEMAP
Gallery confiugration id.static java.lang.String
TC_SELECT_DOC
Gallery configuration id.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsGalleryTabConfiguration()
Default constructor for serialization.CmsGalleryTabConfiguration(java.util.List<I_CmsGalleryProviderConstants.GalleryTabId> tabsList)
Creates a new gallery tab configuration based on a list of tabs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CmsGalleryTabConfiguration
getDefault()
Gets the default tab configuration.I_CmsGalleryProviderConstants.GalleryTabId
getDefaultTab()
Gets the default tab.java.util.List<I_CmsGalleryProviderConstants.GalleryTabId>
getTabs()
Gets the list of tabs.static CmsGalleryTabConfiguration
parse(java.lang.String configStr)
Creates a gallery tab configuration from a configuration string.static I_CmsGalleryProviderConstants.GalleryTabId
parseTabId(java.lang.String tabId)
Parses a tab id from a gallery configuration string.static CmsGalleryTabConfiguration
resolve(java.lang.String configStr)
Given a string which is either the name of a predefined tab configuration or a configuration string, returns the corresponding tab configuration.CmsGalleryTabConfiguration
withDefault(I_CmsGalleryProviderConstants.GalleryTabId defaultTab)
Creates a new tab configuration based on this one, but changes its default tab.
-
-
-
Field Detail
-
DEFAULT_CONFIGURATIONS
public static final java.util.Map<java.lang.String,CmsGalleryTabConfiguration> DEFAULT_CONFIGURATIONS
The map containing the predefined tab configurations.
-
TC_ADE_ADD
public static final java.lang.String TC_ADE_ADD
Gallery configuration id.- See Also:
- Constant Field Values
-
TC_FOLDERS
public static final java.lang.String TC_FOLDERS
Gallery configuration id.- See Also:
- Constant Field Values
-
TC_GALLERIES
public static final java.lang.String TC_GALLERIES
Gallery configuration id.- See Also:
- Constant Field Values
-
TC_SELECT_ALL
public static final java.lang.String TC_SELECT_ALL
Gallery configuration id.- See Also:
- Constant Field Values
-
TC_SELECT_DOC
public static final java.lang.String TC_SELECT_DOC
Gallery configuration id.- See Also:
- Constant Field Values
-
TC_SELECT_ALL_NO_SITEMAP
public static final java.lang.String TC_SELECT_ALL_NO_SITEMAP
Gallery confiugration id.- See Also:
- Constant Field Values
-
m_defaultTab
protected I_CmsGalleryProviderConstants.GalleryTabId m_defaultTab
The id of the default tab.
-
-
Constructor Detail
-
CmsGalleryTabConfiguration
public CmsGalleryTabConfiguration(java.util.List<I_CmsGalleryProviderConstants.GalleryTabId> tabsList)
Creates a new gallery tab configuration based on a list of tabs.- Parameters:
tabsList
- the list of tabs
-
CmsGalleryTabConfiguration
protected CmsGalleryTabConfiguration()
Default constructor for serialization.
-
-
Method Detail
-
getDefault
public static CmsGalleryTabConfiguration getDefault()
Gets the default tab configuration.- Returns:
- the default tab configuration
-
parse
public static CmsGalleryTabConfiguration parse(java.lang.String configStr)
Creates a gallery tab configuration from a configuration string.The string should consist of a comma-separated list of tab ids, omitting the cms_tab_ prefix of the corresponding enum values. The tab which should be used as a default tab should be prefixed with an asterisk '*'.
- Parameters:
configStr
- the configuration string- Returns:
- the parsed tab configuration
-
parseTabId
public static I_CmsGalleryProviderConstants.GalleryTabId parseTabId(java.lang.String tabId)
Parses a tab id from a gallery configuration string.- Parameters:
tabId
- the tab id to parse- Returns:
- the gallery tab id enum value
-
resolve
public static CmsGalleryTabConfiguration resolve(java.lang.String configStr)
Given a string which is either the name of a predefined tab configuration or a configuration string, returns the corresponding tab configuration.- Parameters:
configStr
- a configuration string or predefined configuration name- Returns:
- the gallery tab configuration
-
getDefaultTab
public I_CmsGalleryProviderConstants.GalleryTabId getDefaultTab()
Gets the default tab.- Returns:
- the default tab
-
getTabs
public java.util.List<I_CmsGalleryProviderConstants.GalleryTabId> getTabs()
Gets the list of tabs.- Returns:
- the list of tabs
-
withDefault
public CmsGalleryTabConfiguration withDefault(I_CmsGalleryProviderConstants.GalleryTabId defaultTab)
Creates a new tab configuration based on this one, but changes its default tab.- Parameters:
defaultTab
- the new default tab- Returns:
- the copy with the changed default tab
-
-