Ignore:
Timestamp:
2010-11-25T00:07:52+01:00 (14 years ago)
Author:
bastiK
Message:

add validator plugin to josm core. Original author: Francisco R. Santos (frsantos); major contributions by bilbo, daeron, delta_foxtrot, imi, jttt, jrreid, gabriel, guggis, pieren, rrankin, skela, stoecker, stotz and others

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r3487 r3669  
    2828import java.util.Set;
    2929import java.util.Map.Entry;
     30import java.util.TreeMap;
     31import java.util.TreeSet;
    3032import java.util.concurrent.ExecutionException;
    3133import java.util.concurrent.ExecutorService;
     
    6769public class PluginHandler {
    6870
    69     final public static String [] DEPRECATED_PLUGINS = new String[] {"mappaint", "unglueplugin",
    70         "lang-de", "lang-en_GB", "lang-fr", "lang-it", "lang-pl", "lang-ro",
    71         "lang-ru", "ewmsplugin", "ywms", "tways-0.2", "geotagged", "landsat",
    72         "namefinder", "waypoints", "slippy_map_chooser", "tcx-support", "usertools",
    73         "AgPifoJ", "utilsplugin", "ghost"};
     71    /* deprecated plugins that are removed on start
     72       key - plugin name; value - explanation for deprecation (optional, can be null) */
     73    public final static Map<String, String> DEPRECATED_PLUGINS = new TreeMap<String, String>();
     74    static {
     75        String IN_CORE = tr("integrated into main program");
     76        for (String[] depr : new String[][] {
     77            {"mappaint"}, {"unglueplugin"}, {"lang-de"}, {"lang-en_GB"}, {"lang-fr"},
     78            {"lang-it"}, {"lang-pl"}, {"lang-ro"}, {"lang-ru"}, {"ewmsplugin"},
     79            {"ywms"}, {"tways-0.2"}, {"geotagged"}, {"landsat"}, {"namefinder"},
     80            {"waypoints"}, {"slippy_map_chooser"}, {"tcx-support"}, {"usertools"},
     81            {"AgPifoJ", IN_CORE}, {"utilsplugin", IN_CORE}, {"ghost"},
     82            {"validator", IN_CORE}}) {
     83            DEPRECATED_PLUGINS.put(depr[0], depr.length >= 2 ? depr[1] : null);
     84        }
     85    }
    7486
    7587    final public static String [] UNMAINTAINED_PLUGINS = new String[] {"gpsbabelgui", "Intersect_way"};
     
    90102     */
    91103    private static void filterDeprecatedPlugins(Window parent, Collection<String> plugins) {
    92         Set<String> removedPlugins = new HashSet<String>();
    93         for (String p : DEPRECATED_PLUGINS) {
     104        Set<String> removedPlugins = new TreeSet<String>();
     105        for (String p : DEPRECATED_PLUGINS.keySet()) {
    94106            if (plugins.contains(p)) {
    95107                plugins.remove(p);
     
    103115        // notify user about removed deprecated plugins
    104116        //
    105         StringBuffer sb = new StringBuffer();
     117        StringBuilder sb = new StringBuilder();
    106118        sb.append("<html>");
    107119        sb.append(trn(
     
    112124        sb.append("<ul>");
    113125        for (String name: removedPlugins) {
    114             sb.append("<li>").append(name).append("</li>");
     126            sb.append("<li>").append(name);
     127            String explanation = DEPRECATED_PLUGINS.get(name);
     128            if (explanation != null) {
     129                sb.append(" ("+explanation+")");
     130            }
     131            sb.append("</li>");
    115132        }
    116133        sb.append("</ul>");
  • trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java

    r3530 r3669  
    201201
    202202    protected void filterOldPlugins() {
    203         for (String p : PluginHandler.DEPRECATED_PLUGINS) {
     203        for (String p : PluginHandler.DEPRECATED_PLUGINS.keySet()) {
    204204            if (canceled)return;
    205205            if (availablePlugins.containsKey(p)) {
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r3479 r3669  
    295295    protected List<PluginInformation> filterDeprecatedPlugins(List<PluginInformation> plugins) {
    296296        List<PluginInformation> ret = new ArrayList<PluginInformation>(plugins.size());
    297         HashSet<String> deprecatedPluginNames = new HashSet<String>(Arrays.asList(PluginHandler.DEPRECATED_PLUGINS));
     297        HashSet<String> deprecatedPluginNames = new HashSet<String>(PluginHandler.DEPRECATED_PLUGINS.keySet());
    298298        for (PluginInformation plugin: plugins) {
    299299            if (deprecatedPluginNames.contains(plugin.name)) {
Note: See TracChangeset for help on using the changeset viewer.