- Timestamp:
- 2016-01-25T01:18:18+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 22 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 -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new AdvancedPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link AdvancedPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new AdvancedPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new AudioPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link AudioPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new AudioPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ColorPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ColorPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ColorPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new DisplayPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link DisplayPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new DisplayPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new DrawingPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link DrawingPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new DrawingPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new LafPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link LafPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new LafPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new LanguagePreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link LanguagePreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new LanguagePreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ImageryPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ImageryPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ImageryPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new BackupPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link BackupPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new BackupPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new MapPaintPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link MapPaintPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new MapPaintPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new MapPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link MapPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new MapPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new TaggingPresetPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link TaggingPresetPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new TaggingPresetPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ProjectionPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ProjectionPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ProjectionPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new RemoteControlPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link RemoteControlPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new RemoteControlPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new AuthenticationPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link AuthenticationPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new AuthenticationPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new OverpassServerPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link OverpassServerPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new OverpassServerPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ProxyPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ProxyPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ProxyPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ServerAccessPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ServerAccessPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ServerAccessPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ShortcutPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ShortcutPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ShortcutPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ValidatorPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ValidatorPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ValidatorPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java
r9585 r9622 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 10 11 /** … … 28 29 assertNotNull(new ValidatorTestsPreference.Factory().createPreferenceSetting()); 29 30 } 31 32 /** 33 * Unit test of {@link ValidatorTestsPreference#addGui}. 34 */ 35 @Test 36 public void testAddGui() { 37 new ValidatorTestsPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane()); 38 } 30 39 }
Note:
See TracChangeset
for help on using the changeset viewer.