Ticket #20729: 20729-notification.patch
File 20729-notification.patch, 2.1 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/data/validation/ValidationTask.java
1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.validation; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import java.util.ArrayList; 7 import java.util.Collection; 8 import java.util.List; 9 10 import javax.swing.JOptionPane; 11 4 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 5 13 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 6 14 import org.openstreetmap.josm.gui.MainApplication; 7 15 import org.openstreetmap.josm.gui.MapFrame; 16 import org.openstreetmap.josm.gui.Notification; 8 17 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 9 18 import org.openstreetmap.josm.gui.layer.ValidatorLayer; 10 19 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 11 20 import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor; 12 21 import org.openstreetmap.josm.gui.util.GuiHelper; 13 22 14 import java.util.ArrayList;15 import java.util.Collection;16 import java.util.List;17 18 import static org.openstreetmap.josm.tools.I18n.tr;19 20 23 /** 21 24 * Asynchronous task for running a collection of tests against a collection of primitives 22 25 */ … … 101 104 error.updateIgnored(); 102 105 } 103 106 } 107 108 if (errors.stream().anyMatch(e -> !e.getPrimitives().stream().allMatch(OsmPrimitive::isDrawable))) { 109 final String msg = "<b>" + tr("Validation results contain elements hidden by a filter.") + "</b><br/>" 110 + tr("Please review active filters to see the hidden results."); 111 GuiHelper.runInEDT(() -> new Notification(msg) 112 .setDuration(Notification.TIME_LONG) 113 .setIcon(JOptionPane.WARNING_MESSAGE) 114 .setHelpTopic("Dialog/Validator") 115 .show()); 116 } 104 117 } 105 118 106 119 /**