| Revision 5170,
775 bytes
checked in by Don-vip, 6 weeks ago
(diff) |
|
cleanup svn:mime-type properties preventing Java sources from being viewed as such on Trac
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file. |
|---|
| 2 | package org.openstreetmap.josm.data.preferences; |
|---|
| 3 | |
|---|
| 4 | import java.util.Collection; |
|---|
| 5 | |
|---|
| 6 | import org.openstreetmap.josm.Main; |
|---|
| 7 | |
|---|
| 8 | public class CollectionProperty extends AbstractProperty<Collection<String>> { |
|---|
| 9 | protected final Collection<String> defaultValue; |
|---|
| 10 | |
|---|
| 11 | public CollectionProperty(String key, Collection<String> defaultValue) { |
|---|
| 12 | super(key); |
|---|
| 13 | this.defaultValue = defaultValue; |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | public Collection<String> get() { |
|---|
| 17 | return Main.pref.getCollection(getKey(), getDefaultValue()); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | public boolean put(Collection<String> value) { |
|---|
| 21 | return Main.pref.putCollection(getKey(), value); |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | @Override |
|---|
| 25 | public Collection<String> getDefaultValue() { |
|---|
| 26 | return defaultValue; |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.