- Timestamp:
- 2012-09-13T10:53:21+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5450 r5509 94 94 95 95 public enum PresetType { 96 NODE(/* ICON */"Mf_node"), WAY(/* ICON */"Mf_way"), RELATION(/* ICON */"Mf_relation"), CLOSEDWAY(/* ICON */"Mf_closedway"); 96 NODE(/* ICON */"Mf_node", "node"), 97 WAY(/* ICON */"Mf_way", "way"), 98 RELATION(/* ICON */"Mf_relation", "relation"), 99 CLOSEDWAY(/* ICON */"Mf_closedway", "closedway"); 97 100 98 101 private final String iconName; 99 100 PresetType(String iconName) { 102 private final String name; 103 104 PresetType(String iconName, String name) { 101 105 this.iconName = iconName; 106 this.name = name; 102 107 } 103 108 … … 107 112 108 113 public String getName() { 109 return name ().toLowerCase();114 return name; 110 115 } 111 116 … … 128 133 throw new IllegalArgumentException("Unexpected primitive type: " + type); 129 134 } 135 } 136 137 public static PresetType fromString(String type) { 138 for (PresetType t : PresetType.values()) { 139 if (t.getName().equals(type)) 140 return t; 141 } 142 return null; 130 143 } 131 144 } … … 1298 1311 for (String type : Arrays.asList(types.split(","))) { 1299 1312 try { 1300 PresetType presetType = PresetType. valueOf(type.toUpperCase());1313 PresetType presetType = PresetType.fromString(type); 1301 1314 result.add(presetType); 1302 1315 } catch (IllegalArgumentException e) {
Note:
See TracChangeset
for help on using the changeset viewer.