Ignore:
Timestamp:
2012-08-20T23:06:41+02:00 (12 years ago)
Author:
Don-vip
Message:

Rework Properties a bit to simplify management of Color properties

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/preferences/CollectionProperty.java

    r5170 r5464  
    66import org.openstreetmap.josm.Main;
    77
     8/**
     9 * A property containing a {@code Collection} of {@code String} as value.
     10 */
    811public class CollectionProperty extends AbstractProperty<Collection<String>> {
    9     protected final Collection<String> defaultValue;
    1012
     13    /**
     14     * Constructs a new {@code CollectionProperty}.
     15     * @param key The property key
     16     * @param defaultValue The default value
     17     */
    1118    public CollectionProperty(String key, Collection<String> defaultValue) {
    12         super(key);
    13         this.defaultValue = defaultValue;
     19        super(key, defaultValue);
    1420    }
    1521
     22    @Override
    1623    public Collection<String> get() {
    1724        return Main.pref.getCollection(getKey(), getDefaultValue());
    1825    }
    1926
     27    @Override
    2028    public boolean put(Collection<String> value) {
    2129        return Main.pref.putCollection(getKey(), value);
    2230    }
    23 
    24     @Override
    25     public Collection<String> getDefaultValue() {
    26         return defaultValue;
    27     }
    28 
    2931}
Note: See TracChangeset for help on using the changeset viewer.