Class CmsWrapperPreference
- java.lang.Object
-
- org.opencms.configuration.preferences.CmsWrapperPreference
-
- All Implemented Interfaces:
I_CmsPreference
public class CmsWrapperPreference extends java.lang.Object implements I_CmsPreference
Wrapper used for built-in preferene which have also been configured in opencms-workplace.xml.
-
-
Constructor Summary
Constructors Constructor Description CmsWrapperPreference(CmsPreferenceData prefData, I_CmsPreference wrappedPref)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.dom4j.Element
createConfigurationItem()
Creates the configuration for this preference.java.lang.String
getDefaultValue()
Gets the default value for the preference.java.lang.String
getName()
Gets the preference name.CmsXmlContentProperty
getPropertyDefinition(CmsObject cms)
Gets the metadata describing how the setting should be edited.java.lang.String
getTab()
Gets the preference tab.java.lang.String
getValue(CmsDefaultUserSettings userSettings)
Reads the value of the preference from a CmsDefaultUserSettings instance .boolean
isDisabled(CmsObject cms)
Returns true if the preference is disabled.void
setValue(CmsDefaultUserSettings settings, java.lang.String value)
Sets the value of the preference in a CmsDefaultUserSettings instance.
-
-
-
Constructor Detail
-
CmsWrapperPreference
public CmsWrapperPreference(CmsPreferenceData prefData, I_CmsPreference wrappedPref)
Creates a new instance.- Parameters:
prefData
- the configured preference datawrappedPref
- the preference being wrapped
-
-
Method Detail
-
createConfigurationItem
public org.dom4j.Element createConfigurationItem()
Description copied from interface:I_CmsPreference
Creates the configuration for this preference.- Specified by:
createConfigurationItem
in interfaceI_CmsPreference
- Returns:
- the configuration for this preference
- See Also:
I_CmsPreference.createConfigurationItem()
-
getDefaultValue
public java.lang.String getDefaultValue()
Description copied from interface:I_CmsPreference
Gets the default value for the preference.- Specified by:
getDefaultValue
in interfaceI_CmsPreference
- Returns:
- the default value
- See Also:
I_CmsPreference.getDefaultValue()
-
getName
public java.lang.String getName()
Description copied from interface:I_CmsPreference
Gets the preference name.- Specified by:
getName
in interfaceI_CmsPreference
- Returns:
- the preference name
- See Also:
I_CmsPreference.getName()
-
getPropertyDefinition
public CmsXmlContentProperty getPropertyDefinition(CmsObject cms)
Description copied from interface:I_CmsPreference
Gets the metadata describing how the setting should be edited.- Specified by:
getPropertyDefinition
in interfaceI_CmsPreference
- Parameters:
cms
- the current CMS context- Returns:
- the metadata for the client which describes how the setting should be edited
- See Also:
I_CmsPreference.getPropertyDefinition(org.opencms.file.CmsObject)
-
getTab
public java.lang.String getTab()
Description copied from interface:I_CmsPreference
Gets the preference tab.- Specified by:
getTab
in interfaceI_CmsPreference
- Returns:
- the preference tab
- See Also:
I_CmsPreference.getTab()
-
getValue
public java.lang.String getValue(CmsDefaultUserSettings userSettings)
Description copied from interface:I_CmsPreference
Reads the value of the preference from a CmsDefaultUserSettings instance .- Specified by:
getValue
in interfaceI_CmsPreference
- Parameters:
userSettings
- the user settings from which to read the preference value- Returns:
- the preference value
- See Also:
I_CmsPreference.getValue(org.opencms.configuration.CmsDefaultUserSettings)
-
isDisabled
public boolean isDisabled(CmsObject cms)
Description copied from interface:I_CmsPreference
Returns true if the preference is disabled.- Specified by:
isDisabled
in interfaceI_CmsPreference
- Parameters:
cms
- the current CMS context- Returns:
- true if the preference is disabled
- See Also:
I_CmsPreference.isDisabled(CmsObject)
-
setValue
public void setValue(CmsDefaultUserSettings settings, java.lang.String value)
Description copied from interface:I_CmsPreference
Sets the value of the preference in a CmsDefaultUserSettings instance.- Specified by:
setValue
in interfaceI_CmsPreference
- Parameters:
settings
- the settings used to store the preference valuevalue
- the new value- See Also:
I_CmsPreference.setValue(org.opencms.configuration.CmsDefaultUserSettings, java.lang.String)
-
-