Changeset 17852 in josm for trunk/src/org


Ignore:
Timestamp:
2021-05-02T05:53:40+02:00 (3 years ago)
Author:
GerdP
Message:

fix #20729: Improve validation with data filters enabled

  • show notification when validator was executed with filters and at least one element in the error message is hidden
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/ValidationTask.java

    r17617 r17852  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.validation;
     3
     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;
    311
    412import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    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;
     
    1120import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
    1221import org.openstreetmap.josm.gui.util.GuiHelper;
    13 
    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;
    1922
    2023/**
     
    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
Note: See TracChangeset for help on using the changeset viewer.