Last change
on this file since 5464 was 5464, checked in by Don-vip, 12 years ago |
Rework Properties a bit to simplify management of Color properties
|
-
Property svn:eol-style
set to
native
|
File size:
726 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.preferences;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.Main;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * A property containing a {@code Boolean} value.
|
---|
8 | */
|
---|
9 | public class BooleanProperty extends AbstractProperty<Boolean> {
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Constructs a new {@code BooleanProperty}.
|
---|
13 | * @param key The property key
|
---|
14 | * @param defaultValue The default value
|
---|
15 | */
|
---|
16 | public BooleanProperty(String key, boolean defaultValue) {
|
---|
17 | super(key, defaultValue);
|
---|
18 | }
|
---|
19 |
|
---|
20 | @Override
|
---|
21 | public Boolean get() {
|
---|
22 | return Main.pref.getBoolean(getKey(), defaultValue);
|
---|
23 | }
|
---|
24 |
|
---|
25 | @Override
|
---|
26 | public boolean put(Boolean value) {
|
---|
27 | return Main.pref.put(getKey(), value);
|
---|
28 | }
|
---|
29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.