Changeset 10114 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2016-04-06T23:32:07+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r10035 r10114 113 113 protected final transient List<SourceProvider> sourceProviders; 114 114 115 pr otectedJTable tblIconPaths;116 pr otectedIconPathTableModel iconPathsModel;115 private JTable tblIconPaths; 116 private IconPathTableModel iconPathsModel; 117 117 118 118 protected boolean sourcesInitiallyLoaded; … … 412 412 */ 413 413 public abstract boolean finish(); 414 415 protected boolean doFinish(SourcePrefHelper prefHelper, String iconPref) { 416 boolean changed = prefHelper.put(activeSourcesModel.getSources()); 417 418 if (tblIconPaths != null) { 419 List<String> iconPaths = iconPathsModel.getIconPaths(); 420 421 if (!iconPaths.isEmpty()) { 422 if (Main.pref.putCollection(iconPref, iconPaths)) { 423 changed = true; 424 } 425 } else if (Main.pref.putCollection(iconPref, null)) { 426 changed = true; 427 } 428 } 429 return changed; 430 } 414 431 415 432 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r9231 r10114 86 86 static class MapPaintSourceEditor extends SourceEditor { 87 87 88 private static final String iconpref= "mappaint.icon.sources";88 private static final String ICONPREF = "mappaint.icon.sources"; 89 89 90 90 MapPaintSourceEditor() { … … 99 99 @Override 100 100 public boolean finish() { 101 List<SourceEntry> activeStyles = activeSourcesModel.getSources(); 102 103 boolean changed = MapPaintPrefHelper.INSTANCE.put(activeStyles); 104 105 if (tblIconPaths != null) { 106 List<String> iconPaths = iconPathsModel.getIconPaths(); 107 108 if (!iconPaths.isEmpty()) { 109 if (Main.pref.putCollection(iconpref, iconPaths)) { 110 changed = true; 111 } 112 } else if (Main.pref.putCollection(iconpref, null)) { 113 changed = true; 114 } 115 } 116 return changed; 101 return doFinish(MapPaintPrefHelper.INSTANCE, ICONPREF); 117 102 } 118 103 … … 124 109 @Override 125 110 public Collection<String> getInitialIconPathsList() { 126 return Main.pref.getCollection( iconpref, null);111 return Main.pref.getCollection(ICONPREF, null); 127 112 } 128 113 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r9098 r10114 28 28 import org.openstreetmap.josm.gui.preferences.SourceEditor; 29 29 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry; 30 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader;31 30 import org.openstreetmap.josm.gui.preferences.SourceEntry; 32 31 import org.openstreetmap.josm.gui.preferences.SourceProvider; … … 34 33 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 35 34 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 35 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader; 36 36 import org.openstreetmap.josm.tools.GBC; 37 37 import org.xml.sax.SAXException; … … 183 183 static class TaggingPresetSourceEditor extends SourceEditor { 184 184 185 private static final String iconpref= "taggingpreset.icon.sources";185 private static final String ICONPREF = "taggingpreset.icon.sources"; 186 186 187 187 TaggingPresetSourceEditor() { … … 196 196 @Override 197 197 public boolean finish() { 198 List<SourceEntry> activeStyles = activeSourcesModel.getSources(); 199 200 boolean changed = PresetPrefHelper.INSTANCE.put(activeStyles); 201 202 if (tblIconPaths != null) { 203 List<String> iconPaths = iconPathsModel.getIconPaths(); 204 205 if (!iconPaths.isEmpty()) { 206 if (Main.pref.putCollection(iconpref, iconPaths)) { 207 changed = true; 208 } 209 } else if (Main.pref.putCollection(iconpref, null)) { 210 changed = true; 211 } 212 } 213 return changed; 198 return doFinish(PresetPrefHelper.INSTANCE, ICONPREF); 214 199 } 215 200 … … 221 206 @Override 222 207 public Collection<String> getInitialIconPathsList() { 223 return Main.pref.getCollection( iconpref, null);208 return Main.pref.getCollection(ICONPREF, null); 224 209 } 225 210
Note:
See TracChangeset
for help on using the changeset viewer.