source: josm/trunk/src/org/openstreetmap/josm/data/preferences/BooleanProperty.java@ 3715

Last change on this file since 3715 was 3451, checked in by jttt, 14 years ago

Memory leaks, minor changes needed by wmsplugin

  • Property svn:mime-type set to text/plain
File size: 699 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4import org.openstreetmap.josm.Main;
5
6public class BooleanProperty {
7
8 private final String key;
9 private final boolean defaultValue;
10
11 public BooleanProperty(String key, boolean defaultValue) {
12 this.key = key;
13 this.defaultValue = defaultValue;
14 }
15
16 public boolean get() {
17 return Main.pref.getBoolean(getKey(), isDefaultValue());
18 }
19
20 public boolean put(boolean value) {
21 return Main.pref.put(getKey(), value);
22 }
23
24 public String getKey() {
25 return key;
26 }
27
28 public boolean isDefaultValue() {
29 return defaultValue;
30 }
31
32}
Note: See TracBrowser for help on using the repository browser.