Ticket #20729: 20729-notification.patch

File 20729-notification.patch, 2.1 KB (added by GerdP, 4 years ago)

sligtly simplified patch with different text

  • src/org/openstreetmap/josm/data/validation/ValidationTask.java

     
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.validation;
    33
     4import static org.openstreetmap.josm.tools.I18n.tr;
     5
     6import java.util.ArrayList;
     7import java.util.Collection;
     8import java.util.List;
     9
     10import javax.swing.JOptionPane;
     11
    412import org.openstreetmap.josm.data.osm.OsmPrimitive;
    513import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
    614import org.openstreetmap.josm.gui.MainApplication;
    715import org.openstreetmap.josm.gui.MapFrame;
     16import org.openstreetmap.josm.gui.Notification;
    817import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    918import org.openstreetmap.josm.gui.layer.ValidatorLayer;
    1019import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    1120import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
    1221import org.openstreetmap.josm.gui.util.GuiHelper;
    1322
    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 
    2023/**
    2124 * Asynchronous task for running a collection of tests against a collection of primitives
    2225 */
     
    101104                error.updateIgnored();
    102105            }
    103106        }
     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        }
    104117    }
    105118
    106119    /**