public final class TaggingPresets extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Collection<TaggingPresetListener> |
listeners
The collection of listeners
|
private static java.util.Set<java.lang.String> |
PRESET_ROLE_CACHE
cache for roles found in the preset
|
private static MultiMap<java.lang.String,java.lang.String> |
PRESET_TAG_CACHE
cache for key/value pairs found in the preset
|
private static java.util.Collection<TaggingPreset> |
taggingPresets
The collection of tagging presets
|
Modifier | Constructor and Description |
---|---|
private |
TaggingPresets() |
Modifier and Type | Method and Description |
---|---|
static void |
addListener(TaggingPresetListener listener)
Adds a tagging preset listener.
|
static void |
addTaggingPresets(java.util.Collection<TaggingPreset> presets)
Adds a list of tagging presets to the current list.
|
private static void |
cachePresetItem(TaggingPreset p,
TaggingPresetItem item) |
static void |
cachePresets(java.util.Collection<TaggingPreset> presets)
Initialize the cache for presets.
|
static void |
destroy()
Call to deconstruct the TaggingPresets menus and other information so that it
can be rebuilt later.
|
static java.util.Collection<TaggingPreset> |
getMatchingPresets(java.util.Collection<TaggingPresetType> t,
java.util.Map<java.lang.String,java.lang.String> tags,
boolean onlyShowable)
Replies a new collection of all presets matching the parameters.
|
static java.util.Collection<TaggingPreset> |
getMatchingPresets(IPrimitive primitive)
Replies a new collection of all presets matching the given preset.
|
static java.util.Set<java.lang.String> |
getPresetKeys()
Replies a set of all keys in the tagging presets.
|
static java.util.Set<java.lang.String> |
getPresetRoles()
Replies a set of all roles in the tagging presets.
|
static java.util.Set<java.lang.String> |
getPresetValues(java.lang.String key)
Return set of values for a key in the tagging presets
|
static java.util.Collection<TaggingPreset> |
getTaggingPresets()
Replies a new collection containing all tagging presets.
|
static void |
initialize()
Initialize the tagging presets (load and may display error)
|
static void |
readFromPreferences()
Initializes tagging presets from preferences.
|
static void |
removeListener(TaggingPresetListener listener)
Removes a tagging preset listener.
|
private static final java.util.Collection<TaggingPreset> taggingPresets
private static final MultiMap<java.lang.String,java.lang.String> PRESET_TAG_CACHE
private static final java.util.Set<java.lang.String> PRESET_ROLE_CACHE
private static final java.util.Collection<TaggingPresetListener> listeners
private TaggingPresets()
public static void readFromPreferences()
public static void initialize()
public static void destroy()
public static void cachePresets(java.util.Collection<TaggingPreset> presets)
presets
- Tagging presets to cacheprivate static void cachePresetItem(TaggingPreset p, TaggingPresetItem item)
public static java.util.Collection<TaggingPreset> getTaggingPresets()
public static java.util.Set<java.lang.String> getPresetRoles()
public static java.util.Set<java.lang.String> getPresetKeys()
public static java.util.Set<java.lang.String> getPresetValues(java.lang.String key)
key
- the keypublic static java.util.Collection<TaggingPreset> getMatchingPresets(java.util.Collection<TaggingPresetType> t, java.util.Map<java.lang.String,java.lang.String> tags, boolean onlyShowable)
t
- the preset types to includetags
- the tags to perform matching on, see TaggingPresetItem.matches(Map)
onlyShowable
- whether only showable
presets should be returnedTaggingPreset.matches(Collection, Map, boolean)
public static java.util.Collection<TaggingPreset> getMatchingPresets(IPrimitive primitive)
primitive
- the primitiveTaggingPreset.test(IPrimitive)
public static void addTaggingPresets(java.util.Collection<TaggingPreset> presets)
presets
- The tagging presets to addpublic static void addListener(TaggingPresetListener listener)
listener
- The listener to addpublic static void removeListener(TaggingPresetListener listener)
listener
- The listener to remove