Class SourcePrefHelper
java.lang.Object
org.openstreetmap.josm.data.preferences.sources.SourcePrefHelper
- Direct Known Subclasses:
MapPaintPrefHelper,PresetPrefHelper,ValidatorPrefHelper
Helper class for specialized extensions preferences.
- Since:
- 12649 (extracted from gui.preferences package)
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSourcePrefHelper(String pref, SourceType type) Constructs a newSourcePrefHelperfor the given preference key. -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(Map<String, String> entryStr) Deserializes the given map as a source entry.get()Returns the list of sources.Returns the set of active source URLs.abstract Collection<ExtendedSourceEntry>Returns the default sources provided by JOSM core.booleanput(Collection<? extends SourceEntry> entries) Saves a list of sources to JOSM preferences.serialize(SourceEntry entry) Serializes the given source entry as a map.serializeList(Collection<? extends SourceEntry> entries)
-
Field Details
-
pref
-
type
-
-
Constructor Details
-
SourcePrefHelper
Constructs a newSourcePrefHelperfor the given preference key.- Parameters:
pref- The preference keytype- The source type- Since:
- 12825
-
-
Method Details
-
getDefault
Returns the default sources provided by JOSM core.- Returns:
- the default sources provided by JOSM core
-
serialize
Serializes the given source entry as a map.- Parameters:
entry- source entry to serialize- Returns:
- map (key=value)
-
deserialize
Deserializes the given map as a source entry.- Parameters:
entryStr- map (key=value)- Returns:
- source entry
-
get
Returns the list of sources.- Returns:
- The list of sources
-
put
Saves a list of sources to JOSM preferences.- Parameters:
entries- list of sources- Returns:
true, if something has changed (i.e. value is different than before)
-
serializeList
-
getActiveUrls
Returns the set of active source URLs.- Returns:
- The set of active source URLs.
-