Changeset 1326 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2009-01-23T22:22:10+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
r1212 r1326 29 29 import org.openstreetmap.josm.Main; 30 30 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 31 import org.openstreetmap.josm.gui.preferences.PluginPreference.PluginDescription;32 31 import org.xml.sax.SAXException; 33 32 … … 76 75 public static Collection<String> getSites() { 77 76 return Main.pref.getCollection("pluginmanager.sites", Arrays.asList(pluginSites)); 77 } 78 public static void setSites(Collection<String> c) { 79 Main.pref.putCollection("pluginmanager.sites", c); 78 80 } 79 81 -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r1169 r1326 34 34 public final String mainversion; 35 35 public final String className; 36 public final String requires; 36 37 public final String description; 37 38 public final boolean early; … … 77 78 Attributes attr = manifest.getMainAttributes(); 78 79 className = attr.getValue("Plugin-Class"); 80 requires = attr.getValue("Plugin-Requires"); 79 81 description = attr.getValue("Plugin-Description"); 80 82 early = Boolean.parseBoolean(attr.getValue("Plugin-Early")); … … 107 109 early = false; 108 110 stage = 50; 111 requires = null; 109 112 version = null; 110 113 author = null; … … 215 218 return all; 216 219 } 217 218 219 /**220 * Return information about a loaded plugin.221 *222 * Note that if you call this in your plugins bootstrap, you may get <code>null</code> if223 * the plugin requested is not loaded yet.224 *225 * @return The PluginInformation to a specific plugin, but only if the plugin is loaded.226 * If it is not loaded, <code>null</code> is returned.227 */228 public static PluginInformation getLoaded(String pluginName) {229 for (PluginProxy p : Main.plugins)230 if (p.info.name.equals(pluginName))231 return p.info;232 return null;233 }234 220 } 235 221 -
trunk/src/org/openstreetmap/josm/plugins/PluginProxy.java
r1169 r1326 7 7 import org.openstreetmap.josm.gui.download.DownloadSelection; 8 8 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 9 9 import org.openstreetmap.josm.tools.BugReportExceptionHandler; 10 10 11 11 /** … … 31 31 } catch (NoSuchMethodException e) { 32 32 } catch (Exception e) { 33 throw new PluginException(this, info.name, e);33 BugReportExceptionHandler.handleException(new PluginException(this, info.name, e)); 34 34 } 35 35 } … … 41 41 return null; 42 42 } catch (Exception e) { 43 throw new PluginException(this, info.name, e);43 BugReportExceptionHandler.handleException(new PluginException(this, info.name, e)); 44 44 } 45 return null; 45 46 } 46 47 … … 51 52 // ignore 52 53 } catch (Exception e) { 53 throw new PluginException(this, info.name, e);54 BugReportExceptionHandler.handleException(new PluginException(this, info.name, e)); 54 55 } 55 56 }
Note:
See TracChangeset
for help on using the changeset viewer.