Ignore:
Timestamp:
2017-08-26T21:28:55+02:00 (3 years ago)
Author:
Don-vip
Message:

see #14704 - allow to export validator errors ("Save as" in validator layer contextual menu). Same format than Osmose

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r12649 r12667  
    99import java.util.Collection;
    1010import java.util.Collections;
    11 import java.util.EnumMap;
    1211import java.util.Enumeration;
    1312import java.util.HashSet;
     
    1514import java.util.Map;
    1615import java.util.Set;
    17 import java.util.TreeMap;
    1816import java.util.function.Predicate;
    19 import java.util.stream.Collectors;
    2017
    2118import javax.swing.JTree;
     
    4037import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
    4138import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
     39import org.openstreetmap.josm.data.validation.OsmValidator;
    4240import org.openstreetmap.josm.data.validation.Severity;
    4341import org.openstreetmap.josm.data.validation.TestError;
     
    4543import org.openstreetmap.josm.gui.MainApplication;
    4644import org.openstreetmap.josm.gui.util.GuiHelper;
    47 import org.openstreetmap.josm.tools.AlphanumComparator;
    4845import org.openstreetmap.josm.tools.Destroyable;
    4946import org.openstreetmap.josm.tools.ListenerList;
     
    191188        }
    192189        Map<Severity, Map<String, Map<String, List<TestError>>>> errorsBySeverityMessageDescription
    193             = errors.stream().filter(filterToUse).collect(
    194                     Collectors.groupingBy(TestError::getSeverity, () -> new EnumMap<>(Severity.class),
    195                             Collectors.groupingBy(TestError::getMessage, () -> new TreeMap<>(AlphanumComparator.getInstance()),
    196                                     Collectors.groupingBy(e -> e.getDescription() == null ? "" : e.getDescription(),
    197                                             () -> new TreeMap<>(AlphanumComparator.getInstance()),
    198                                             Collectors.toList()
    199                                     ))));
     190            = OsmValidator.getErrorsBySeverityMessageDescription(errors, filterToUse);
    200191
    201192        final List<TreePath> expandedPaths = new ArrayList<>();
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r12630 r12667  
    275275    @Override
    276276    public File createAndOpenSaveFileChooser() {
    277         return SaveActionBase.createAndOpenSaveFileChooser(tr("Save GPX file"), NoteExporter.FILE_FILTER);
     277        return SaveActionBase.createAndOpenSaveFileChooser(tr("Save Note file"), NoteExporter.FILE_FILTER);
    278278    }
    279279
  • trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java

    r12636 r12667  
    55
    66import java.awt.Graphics2D;
     7import java.io.File;
    78import java.util.Collections;
    89import java.util.Enumeration;
     
    1516
    1617import org.openstreetmap.josm.actions.RenameLayerAction;
     18import org.openstreetmap.josm.actions.SaveActionBase;
    1719import org.openstreetmap.josm.data.Bounds;
    1820import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     
    2931import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
    3032import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
     33import org.openstreetmap.josm.io.ValidatorErrorExporter;
    3134import org.openstreetmap.josm.tools.ImageProvider;
    3235import org.openstreetmap.josm.tools.MultiMap;
     
    140143                new RenameLayerAction(null, this),
    141144                SeparatorLayerAction.INSTANCE,
    142                 new LayerListPopup.InfoAction(this) };
     145                new LayerListPopup.InfoAction(this),
     146                new LayerSaveAsAction(this)
     147                };
     148    }
     149
     150    @Override
     151    public File createAndOpenSaveFileChooser() {
     152        return SaveActionBase.createAndOpenSaveFileChooser(tr("Save Validation errors file"), ValidatorErrorExporter.FILE_FILTER);
    143153    }
    144154
Note: See TracChangeset for help on using the changeset viewer.