Last change
on this file since 3730 was 3720, checked in by bastiK, 13 years ago |
added missing svn:eol-style
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/plain
|
File size:
728 bytes
|
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 abstract class ParametrizedCollectionProperty {
|
---|
9 |
|
---|
10 | private final Collection<String> defaultValue;
|
---|
11 |
|
---|
12 | public ParametrizedCollectionProperty(Collection<String> defaultValue) {
|
---|
13 | this.defaultValue = defaultValue;
|
---|
14 | }
|
---|
15 |
|
---|
16 | protected abstract String getKey(String... params);
|
---|
17 |
|
---|
18 | public Collection<String> get(String... params) {
|
---|
19 | return Main.pref.getCollection(getKey(params), defaultValue);
|
---|
20 | }
|
---|
21 |
|
---|
22 | public boolean put(Collection<String> value, String... params) {
|
---|
23 | return Main.pref.putCollection(getKey(params), value);
|
---|
24 | }
|
---|
25 |
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.