Ignore:
Timestamp:
2011-02-09T09:53:35+01:00 (14 years ago)
Author:
bastiK
Message:

use classloader to find projections from plugins

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

Legend:

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

    r3730 r3874  
    159159
    160160    /**
     161     * Add here all ClassLoader whose resource should be searched.
     162     */
     163    private static final List<ClassLoader> sources = new LinkedList<ClassLoader>();
     164
     165    static {
     166        try {
     167            sources.add(ClassLoader.getSystemClassLoader());
     168            sources.add(org.openstreetmap.josm.gui.MainApplication.class.getClassLoader());
     169        } catch (SecurityException ex) {
     170            sources.add(ImageProvider.class.getClassLoader());
     171        }
     172    }
     173
     174    public static Collection<ClassLoader> getResourceClassLoaders() {
     175        return Collections.unmodifiableCollection(sources);
     176    }
     177
     178    /**
    161179     * Removes deprecated plugins from a collection of plugins. Modifies the
    162180     * collection <code>plugins</code>.
     
    516534
    517535            ClassLoader pluginClassLoader = createClassLoader(toLoad);
    518             ImageProvider.sources.add(0, pluginClassLoader);
     536            sources.add(0, pluginClassLoader);
    519537            monitor.setTicksCount(toLoad.size());
    520538            for (PluginInformation info : toLoad) {
  • trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java

    r3730 r3874  
    6565            availablePlugins.put(info.getName(), info);
    6666        } else {
    67             availablePlugins.get(info.getName()).localversion = info.version;
     67            PluginInformation current = availablePlugins.get(info.getName());
     68            current.localversion = info.version;
    6869            if (info.icon != null) {
    69                 availablePlugins.get(info.getName()).icon = info.icon;
    70             }
     70                current.icon = info.icon;
     71            }
     72            current.early = info.early;
     73            current.className = info.className;
     74            current.libraries = info.libraries;
     75            current.stage = info.stage;
     76            current.requires = info.requires;
    7177        }
    7278    }
Note: See TracChangeset for help on using the changeset viewer.