Changeset 1738 in josm for trunk/src/org
- Timestamp:
- 2009-07-05T19:42:18+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
r1733 r1738 23 23 import java.util.Map; 24 24 import java.util.Set; 25 import java.util.SortedMap;26 25 import java.util.TreeMap; 27 26 import java.util.Map.Entry; … … 70 69 PluginInformation description = availablePlugins.get(local.name); 71 70 72 if (description != null && (description.version == null || description.version.equals("")) ? 73 (local.version != null && local.version.equals("")) : !description.version.equals(local.version)) { 71 if (description.version != null && !description.version.equals(local.version)) { 74 72 toUpdate.add(description); 75 73 toUpdateStr.append(description.name+"\n"); … … 97 95 public boolean finish() { 98 96 Collection<PluginInformation> toDownload = new LinkedList<PluginInformation>(); 97 Collection<String> installedPlugins = Main.pref.getCollection("plugins", null); 98 99 99 String msg = ""; 100 100 for (Entry<String, Boolean> entry : pluginMap.entrySet()) { 101 if(entry.getValue()) 101 if(entry.getValue() && !installedPlugins.contains(entry.getKey())) 102 102 { 103 103 String name = entry.getKey(); … … 136 136 /* return true when plugin list changed */ 137 137 public void drawPanel(JPanel pluginPanel) { 138 availablePlugins = getAvailablePlugins();138 loadPlugins(); 139 139 Collection<String> enabledPlugins = Main.pref.getCollection("plugins", null); 140 140 … … 222 222 } 223 223 224 /** 225 * Return information about a loaded plugin. 226 * 227 * Note that if you call this in your plugins bootstrap, you may get <code>null</code> if 228 * the plugin requested is not loaded yet. 229 * 230 * @return The PluginInformation to a specific plugin, but only if the plugin is loaded. 231 * If it is not loaded, <code>null</code> is returned. 232 */ 233 private static PluginInformation getLoaded(String pluginName) { 234 for (PluginProxy p : PluginHandler.pluginList) 235 if (p.info.name.equals(pluginName)) 236 return p.info; 237 return null; 238 } 239 240 private Map<String, PluginInformation> getAvailablePlugins() { 241 SortedMap<String, PluginInformation> availablePlugins = new TreeMap<String, PluginInformation>(new Comparator<String>(){ 224 private void loadPlugins() { 225 availablePlugins = new TreeMap<String, PluginInformation>(new Comparator<String>(){ 242 226 public int compare(String o1, String o2) { 243 227 return o1.compareToIgnoreCase(o2); … … 346 330 localPlugins.put(proxy.info.name, proxy.info); 347 331 } 348 return availablePlugins;349 332 } 350 333 }
Note:
See TracChangeset
for help on using the changeset viewer.