source: josm/trunk/src/org/openstreetmap/josm/data/preferences/EnumProperty.java@ 9978

Last change on this file since 9978 was 9743, checked in by bastiK, 8 years ago

applied #12438 - hide items from list of recently added tags (patch by kolesar; minor changes)

  • Property svn:eol-style set to native
File size: 862 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4import org.openstreetmap.josm.Main;
5
6/**
7 * A property containing an {@code Enum} value.
8 *
9 * @author András Kolesár
10 * @param <T> the {@code Enum} class
11 */
12public class EnumProperty<T extends Enum<T>> extends ParametrizedEnumProperty<T> {
13
14 protected final String key;
15
16 /**
17 * Constructs a new {@code EnumProperty}.
18 * @param key The property key
19 * @param enumClass The {@code Enum} class
20 * @param defaultValue The default value
21 */
22 public EnumProperty(String key, Class<T> enumClass, T defaultValue) {
23 super(enumClass, defaultValue);
24 this.key = key;
25 if (Main.pref != null) {
26 get();
27 }
28 }
29
30 @Override
31 protected String getKey(String... params) {
32 return key;
33 }
34}
Note: See TracBrowser for help on using the repository browser.