- Timestamp:
- 2016-01-25T01:18:18+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r9078 r9622 72 72 private PreferencesTable table; 73 73 74 private final Map<String, String> profileTypes = new LinkedHashMap<>(); 75 76 private final Comparator<PrefEntry> customComparator = new Comparator<PrefEntry>() { 77 @Override 78 public int compare(PrefEntry o1, PrefEntry o2) { 79 if (o1.isChanged() && !o2.isChanged()) 80 return -1; 81 if (o2.isChanged() && !o1.isChanged()) 82 return 1; 83 if (!(o1.isDefault()) && o2.isDefault()) 84 return -1; 85 if (!(o2.isDefault()) && o1.isDefault()) 86 return 1; 87 return o1.compareTo(o2); 88 } 89 }; 90 74 91 private AdvancedPreference() { 75 92 super(/* ICON(preferences/) */ "advanced", tr("Advanced Preferences"), tr("Setting Preference entries directly. Use with caution!")); … … 136 153 edit.addActionListener(new ActionListener() { 137 154 @Override public void actionPerformed(ActionEvent e) { 138 boolean ok = table.editPreference(gui);139 if (ok)applyFilter();155 if (table.editPreference(gui)) 156 applyFilter(); 140 157 } 141 158 }); … … 211 228 if (fc != null) { 212 229 File[] sel = fc.isMultiSelectionEnabled() ? fc.getSelectedFiles() : (new File[]{fc.getSelectedFile()}); 213 if (sel.length == 1 && !sel[0].getName().contains(".")) sel[0] = new File(sel[0].getAbsolutePath()+".xml"); 230 if (sel.length == 1 && !sel[0].getName().contains(".")) 231 sel[0] = new File(sel[0].getAbsolutePath()+".xml"); 214 232 return sel; 215 233 } … … 254 272 private void readPreferencesFromXML() { 255 273 File[] files = askUserForCustomSettingsFiles(false, tr("Open JOSM customization file")); 256 if (files.length == 0) return; 274 if (files.length == 0) 275 return; 257 276 258 277 Preferences tmpPrefs = CustomConfigurator.clonePreferences(Main.pref); … … 276 295 applyFilter(); 277 296 } 278 279 private final Comparator<PrefEntry> customComparator = new Comparator<PrefEntry>() {280 @Override281 public int compare(PrefEntry o1, PrefEntry o2) {282 if (o1.isChanged() && !o2.isChanged()) return -1;283 if (o2.isChanged() && !o1.isChanged()) return 1;284 if (!(o1.isDefault()) && o2.isDefault()) return -1;285 if (!(o2.isDefault()) && o1.isDefault()) return 1;286 return o1.compareTo(o2);287 }288 };289 297 290 298 private List<PrefEntry> prepareData(Map<String, Setting<?>> loaded, Map<String, Setting<?>> orig, Map<String, Setting<?>> defaults) { … … 320 328 return data; 321 329 } 322 323 private final Map<String, String> profileTypes = new LinkedHashMap<>();324 330 325 331 private JPopupMenu buildPopupMenu() { … … 459 465 } 460 466 } 461 if (table != null) table.fireDataChanged(); 467 if (table != null) 468 table.fireDataChanged(); 462 469 } 463 470
Note:
See TracChangeset
for help on using the changeset viewer.