Changeset 4866 in osm for applications/editors/josm/plugins
- Timestamp:
- 2007-10-07T20:55:36+02:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java
r4843 r4866 62 62 { 63 63 PreferenceEditor.importOldPreferences(); 64 initializeTests( get Tests(true, true) );64 initializeTests( getAllTests() ); 65 65 } 66 66 … … 119 119 return (OSMValidatorPlugin)Util.getPlugin(OSMValidatorPlugin.class); 120 120 } 121 121 122 /** Gets a map from simple names to all tests. */ 123 public static Map<String, Test> getAllTestsMap() { 124 Map<String, Test> tests = new HashMap<String, Test>(); 125 for(Class<Test> testClass : getAllAvailableTests() ) 126 { 127 try { 128 Test test = testClass.newInstance(); 129 tests.put(testClass.getSimpleName(), test); 130 } 131 catch( Exception e) 132 { 133 e.printStackTrace(); 134 continue; 135 } 136 } 137 return tests; 138 } 139 140 /** Gets a collection of all tests. */ 141 public static Collection<Test> getAllTests() { 142 return getAllTestsMap().values(); 143 } 144 122 145 /** 123 146 * Gets a collection with the available tests … … 130 153 { 131 154 Set<Test> tests = new HashSet<Test>(); 132 Map<String, Test> enabledTests = new LinkedHashMap<String, Test>(); 133 for(Class<Test> testClass : getAllAvailableTests() ) 134 { 135 try { 136 Test test = testClass.newInstance(); 137 enabledTests.put(testClass.getSimpleName(), test); 138 } 139 catch( Exception e) 140 { 141 e.printStackTrace(); 142 continue; 143 } 144 } 155 Map<String, Test> enabledTests = getAllTestsMap(); 145 156 146 157 Pattern regexp = Pattern.compile("(\\w+)=(true|false),?"); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java
r4162 r4866 47 47 testPanel.add( new JLabel("On upload"), GBC.eop() ); 48 48 49 allTests = OSMValidatorPlugin.get Tests(true, true);49 allTests = OSMValidatorPlugin.getAllTests(); 50 50 for(Test test: allTests) 51 51 {
Note:
See TracChangeset
for help on using the changeset viewer.