| Revision 5170,
655 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 org.openstreetmap.josm.Main; |
|---|
| 5 | |
|---|
| 6 | public class BooleanProperty extends AbstractProperty<Boolean> { |
|---|
| 7 | |
|---|
| 8 | protected final boolean defaultValue; |
|---|
| 9 | |
|---|
| 10 | public BooleanProperty(String key, boolean defaultValue) { |
|---|
| 11 | super(key); |
|---|
| 12 | this.defaultValue = defaultValue; |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | public boolean get() { |
|---|
| 16 | return Main.pref.getBoolean(getKey(), defaultValue); |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | public boolean put(boolean value) { |
|---|
| 20 | return Main.pref.put(getKey(), value); |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | @Override |
|---|
| 24 | public Boolean getDefaultValue() { |
|---|
| 25 | return defaultValue; |
|---|
| 26 | } |
|---|
| 27 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.