public class StaticUserPreferenceProvider extends AbstractLogEnabled implements UserPreferenceProvider, Contextualizable, Serviceable, Configurable, PluginAware, Disposable
Modifier and Type | Class and Description |
---|---|
(package private) class |
StaticUserPreferenceProvider.StaticUserPreference
A user pref with additionnal static information such as workspace
|
(package private) class |
StaticUserPreferenceProvider.UserPreferenceParser
Parser for UserPreference.
|
Modifier and Type | Field and Description |
---|---|
protected Context |
_context
Avalon context
|
protected ThreadSafeComponentManager<Enumerator> |
_enumeratorManager
ComponentManager for
Enumerator s. |
protected String |
_pluginName
The plugin name.
|
protected Map<String,UserPreference> |
_preferences
The user preferences, indexed by Id
|
protected ServiceManager |
_serviceManager
Avalon service manager
|
protected ThreadSafeComponentManager<Validator> |
_validatorManager
ComponentManager for
Validator s. |
CONTEXT_VAR_WORKSPACE
Constructor and Description |
---|
StaticUserPreferenceProvider() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Configuration configuration) |
protected void |
configurePreference(StaticUserPreferenceProvider.UserPreferenceParser prefParser,
Configuration configuration)
Configure a user preference.
|
void |
contextualize(Context context) |
void |
dispose() |
Collection<UserPreference> |
getPreferences(Map<String,String> context)
Get this provider's preferences.
|
void |
service(ServiceManager manager) |
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
getLogger, setLogger
protected Map<String,UserPreference> _preferences
protected ThreadSafeComponentManager<Validator> _validatorManager
Validator
s.protected ThreadSafeComponentManager<Enumerator> _enumeratorManager
Enumerator
s.protected ServiceManager _serviceManager
protected String _pluginName
public StaticUserPreferenceProvider()
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void dispose()
dispose
in interface Disposable
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
protected void configurePreference(StaticUserPreferenceProvider.UserPreferenceParser prefParser, Configuration configuration) throws ConfigurationException
prefParser
- the preference parser.configuration
- The preference configuration.ConfigurationException
- if configuration is incomplete or invalid.public Collection<UserPreference> getPreferences(Map<String,String> context)
UserPreferenceProvider
getPreferences
in interface UserPreferenceProvider
context
- a Map of context variables.