- Timestamp:
- 2020-08-03T23:09:13+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
r16844 r16846 104 104 } 105 105 } else if (stg instanceof ListSetting) { 106 ok = do EditList(gui, e, (ListSetting) stg);106 ok = doAddEditList(gui, e, (ListSetting) stg); 107 107 } else if (stg instanceof ListListSetting) { 108 ok = do EditListList(gui, e, (ListListSetting) stg);108 ok = doAddEditListList(gui, e, (ListListSetting) stg); 109 109 } else if (stg instanceof MapListSetting) { 110 ok = do EditMapList(gui, e, (MapListSetting) stg);110 ok = doAddEditMapList(gui, e, (MapListSetting) stg); 111 111 } 112 112 return ok; 113 }114 115 private static boolean doEditList(final JComponent gui, final PrefEntry e, ListSetting lSetting) {116 ListEditor lEditor = new ListEditor(gui, e, lSetting);117 lEditor.showDialog();118 if (lEditor.getValue() == 1) {119 List<String> data = lEditor.getData();120 if (!lSetting.equalVal(data)) {121 e.setValue(new ListSetting(data));122 return true;123 }124 }125 return false;126 }127 128 private static boolean doEditListList(final JComponent gui, final PrefEntry e, ListListSetting llSetting) {129 ListListEditor llEditor = new ListListEditor(gui, e, llSetting);130 llEditor.showDialog();131 if (llEditor.getValue() == 1) {132 List<List<String>> data = llEditor.getData();133 if (!llSetting.equalVal(data)) {134 e.setValue(new ListListSetting(data));135 return true;136 }137 }138 return false;139 }140 141 private static boolean doEditMapList(final JComponent gui, final PrefEntry e, MapListSetting mlSetting) {142 MapListEditor mlEditor = new MapListEditor(gui, e, mlSetting);143 mlEditor.showDialog();144 if (mlEditor.getValue() == 1) {145 List<Map<String, String>> data = mlEditor.getData();146 if (!mlSetting.equalVal(data)) {147 e.setValue(new MapListSetting(data));148 return true;149 }150 }151 return false;152 113 } 153 114 … … 193 154 ListSetting lSetting = new ListSetting(null); 194 155 pe = new PrefEntry(tkey.getText(), lSetting, lSetting, false); 195 ok = doAdd List(gui, pe, lSetting);156 ok = doAddEditList(gui, pe, lSetting); 196 157 } else if (rbListList.isSelected()) { 197 158 ListListSetting llSetting = new ListListSetting(null); 198 159 pe = new PrefEntry(tkey.getText(), llSetting, llSetting, false); 199 ok = doAdd ListList(gui, pe, llSetting);160 ok = doAddEditListList(gui, pe, llSetting); 200 161 } else if (rbMapList.isSelected()) { 201 162 MapListSetting mlSetting = new MapListSetting(null); 202 163 pe = new PrefEntry(tkey.getText(), mlSetting, mlSetting, false); 203 ok = doAdd MapList(gui, pe, mlSetting);164 ok = doAddEditMapList(gui, pe, mlSetting); 204 165 } 205 166 } … … 225 186 } 226 187 227 private static boolean doAdd List(final JComponent gui, PrefEntry pe, ListSetting lSetting) {188 private static boolean doAddEditList(final JComponent gui, PrefEntry pe, ListSetting lSetting) { 228 189 ListEditor lEditor = new ListEditor(gui, pe, lSetting); 229 190 lEditor.showDialog(); … … 238 199 } 239 200 240 private static boolean doAdd ListList(final JComponent gui, PrefEntry pe, ListListSetting llSetting) {201 private static boolean doAddEditListList(final JComponent gui, PrefEntry pe, ListListSetting llSetting) { 241 202 ListListEditor llEditor = new ListListEditor(gui, pe, llSetting); 242 203 llEditor.showDialog(); … … 251 212 } 252 213 253 private static boolean doAdd MapList(final JComponent gui, PrefEntry pe, MapListSetting mlSetting) {214 private static boolean doAddEditMapList(final JComponent gui, PrefEntry pe, MapListSetting mlSetting) { 254 215 MapListEditor mlEditor = new MapListEditor(gui, pe, mlSetting); 255 216 mlEditor.showDialog();
Note:
See TracChangeset
for help on using the changeset viewer.