Changeset 5464 in josm for trunk/src/org/openstreetmap/josm/data/preferences/CollectionProperty.java
- Timestamp:
- 2012-08-20T23:06:41+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/preferences/CollectionProperty.java
r5170 r5464 6 6 import org.openstreetmap.josm.Main; 7 7 8 /** 9 * A property containing a {@code Collection} of {@code String} as value. 10 */ 8 11 public class CollectionProperty extends AbstractProperty<Collection<String>> { 9 protected final Collection<String> defaultValue;10 12 13 /** 14 * Constructs a new {@code CollectionProperty}. 15 * @param key The property key 16 * @param defaultValue The default value 17 */ 11 18 public CollectionProperty(String key, Collection<String> defaultValue) { 12 super(key); 13 this.defaultValue = defaultValue; 19 super(key, defaultValue); 14 20 } 15 21 22 @Override 16 23 public Collection<String> get() { 17 24 return Main.pref.getCollection(getKey(), getDefaultValue()); 18 25 } 19 26 27 @Override 20 28 public boolean put(Collection<String> value) { 21 29 return Main.pref.putCollection(getKey(), value); 22 30 } 23 24 @Override25 public Collection<String> getDefaultValue() {26 return defaultValue;27 }28 29 31 }
Note:
See TracChangeset
for help on using the changeset viewer.