public final class ItemUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PREFERENCE_DELIMITER
Delimiter character used to serialize a list into preferences.
|
Modifier and Type | Method and Description |
---|---|
static <T> Set<IItemDescriptor<T>> |
getActiveItems(IItemRegistry<T> registry,
String disabledItemPreferenceKey)
Get all active item from a registry.
|
static org.osgi.service.prefs.Preferences |
getConfigurationPreferenceNode(String type,
String itemId)
Return the node holding the configuration for an item.
|
static <T> IItemDescriptor<T> |
getDefaultItemDescriptor(IItemRegistry<T> registry,
String preferenceKey,
org.eclipse.core.runtime.preferences.IEclipsePreferences itemPreferences)
Get an item descriptor using the preferences.
|
static <T> T |
getItem(IItemRegistry<T> registry,
String preferenceKey,
org.eclipse.core.runtime.preferences.IEclipsePreferences itemPreferences)
Get an item using the preferences.
|
static <T> List<IItemDescriptor<T>> |
getItemsDescriptor(IItemRegistry<T> registry,
String preferenceKey,
org.osgi.service.prefs.Preferences itemPreferences)
Get a list of
IItemDescriptor from preferences. |
public static final String PREFERENCE_DELIMITER
public static <T> T getItem(IItemRegistry<T> registry, String preferenceKey, org.eclipse.core.runtime.preferences.IEclipsePreferences itemPreferences)
T
- Type of itemregistry
- The item registrypreferenceKey
- The preference to retrieve the key.itemPreferences
- Eclipse preference where are stored the items to usepublic static <T> IItemDescriptor<T> getDefaultItemDescriptor(IItemRegistry<T> registry, String preferenceKey, org.eclipse.core.runtime.preferences.IEclipsePreferences itemPreferences)
T
- Type of itemregistry
- IItemRegistry
of the item typepreferenceKey
- Preference key use to retrieve the itemitemPreferences
- IEclipsePreferences
where are stored the item preferences.IItemDescriptor
public static <T> List<IItemDescriptor<T>> getItemsDescriptor(IItemRegistry<T> registry, String preferenceKey, org.osgi.service.prefs.Preferences itemPreferences)
IItemDescriptor
from preferences.T
- Type of IItemDescriptor
registry
- Registry for the IItemDescriptor
preferenceKey
- Key for this IItemDescriptor
in preferencesitemPreferences
- Preferences
where are stored IItemDescriptor
valuesIItemDescriptor
or null if nothing in preferencespublic static org.osgi.service.prefs.Preferences getConfigurationPreferenceNode(String type, String itemId)
type
- Type of item.itemId
- Id of the item we want to retrieve the configuration for.Preferences
holding the configuration.public static <T> Set<IItemDescriptor<T>> getActiveItems(IItemRegistry<T> registry, String disabledItemPreferenceKey)
(Filter out all disable element stored in preferences)
T
- Item typeregistry
- Registry holding all items of this kinddisabledItemPreferenceKey
- Preference key where are stored disabled items.Set
of active items
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.