Changeset 10696 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2016-08-01T21:17:23+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r10463 r10696 19 19 import java.util.Map.Entry; 20 20 import java.util.Set; 21 import java.util. TreeSet;21 import java.util.stream.Collectors; 22 22 23 23 import org.openstreetmap.josm.Main; … … 28 28 import org.openstreetmap.josm.gui.ExtendedDialog; 29 29 import org.openstreetmap.josm.gui.preferences.SourceEditor; 30 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;31 import org.openstreetmap.josm.gui.preferences.SourceEntry;32 30 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference; 33 31 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; … … 37 35 import org.openstreetmap.josm.tools.PlatformHookUnixoid; 38 36 import org.openstreetmap.josm.tools.Shortcut; 37 import org.openstreetmap.josm.tools.Utils; 39 38 import org.openstreetmap.josm.tools.bugreport.BugReportSender; 40 39 import org.openstreetmap.josm.tools.bugreport.DebugTextDisplay; … … 153 152 } 154 153 } 155 text.append( '\n').append(PluginHandler.getBugReportText()).append('\n');156 154 text.append("\n"); 155 appendCollection(text, "Plugins", Utils.transform(PluginHandler.getBugReportInformation(), i -> "+ " + i)); 157 156 appendCollection(text, "Tagging presets", getCustomUrls(TaggingPresetPreference.PresetPrefHelper.INSTANCE)); 158 157 appendCollection(text, "Map paint styles", getCustomUrls(MapPaintPreference.MapPaintPrefHelper.INSTANCE)); 159 158 appendCollection(text, "Validator rules", getCustomUrls(ValidatorTagCheckerRulesPreference.RulePrefHelper.INSTANCE)); 160 appendCollection(text, "Last errors/warnings", Main.getLastErrorAndWarnings());159 appendCollection(text, "Last errors/warnings", Utils.transform(Main.getLastErrorAndWarnings(), i -> "- " + i)); 161 160 162 161 String osmApi = OsmApi.getOsmApi().getServerUrl(); … … 169 168 170 169 private static Collection<String> getCustomUrls(SourceEditor.SourcePrefHelper helper) { 171 Set<String> set = new TreeSet<>(); 172 for (SourceEntry entry : helper.get()) { 173 set.add(entry.url); 174 } 175 for (ExtendedSourceEntry def : helper.getDefault()) { 176 set.remove(def.url); 177 } 178 return set; 170 final Set<String> defaultUrls = helper.getDefault().stream() 171 .map(i -> i.url) 172 .collect(Collectors.toSet()); 173 return helper.get().stream() 174 .filter(i -> !defaultUrls.contains(i.url)) 175 .map(i -> (i.active ? "+ " : "- ") + i.url) 176 .collect(Collectors.toList()); 179 177 } 180 178 … … 224 222 } 225 223 226 private static <T> void appendCollection(StringBuilder text, String label, Collection<T> col) {224 private static void appendCollection(StringBuilder text, String label, Collection<String> col) { 227 225 if (!col.isEmpty()) { 228 text.append(label +":\n");229 for ( To : col) {230 text.append( "- ").append(paramCleanup(o.toString())).append('\n');226 text.append(label).append(":\n"); 227 for (String o : col) { 228 text.append(paramCleanup(o)).append('\n'); 231 229 } 232 230 text.append('\n');
Note:
See TracChangeset
for help on using the changeset viewer.