Ignore:
Timestamp:
2009-01-23T22:22:10+01:00 (16 years ago)
Author:
stoecker
Message:

reworked plugin handling a lot, more to come

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  
    2929import org.openstreetmap.josm.Main;
    3030import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    31 import org.openstreetmap.josm.gui.preferences.PluginPreference.PluginDescription;
    3231import org.xml.sax.SAXException;
    3332
     
    7675    public static Collection<String> getSites() {
    7776        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);
    7880    }
    7981
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r1169 r1326  
    3434    public final String mainversion;
    3535    public final String className;
     36    public final String requires;
    3637    public final String description;
    3738    public final boolean early;
     
    7778                Attributes attr = manifest.getMainAttributes();
    7879                className = attr.getValue("Plugin-Class");
     80                requires = attr.getValue("Plugin-Requires");
    7981                description = attr.getValue("Plugin-Description");
    8082                early = Boolean.parseBoolean(attr.getValue("Plugin-Early"));
     
    107109                early = false;
    108110                stage = 50;
     111                requires = null;
    109112                version = null;
    110113                author = null;
     
    215218        return all;
    216219    }
    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> if
    223      * 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     }
    234220}
    235221
  • trunk/src/org/openstreetmap/josm/plugins/PluginProxy.java

    r1169 r1326  
    77import org.openstreetmap.josm.gui.download.DownloadSelection;
    88import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    9 
     9import org.openstreetmap.josm.tools.BugReportExceptionHandler;
    1010
    1111/**
     
    3131        } catch (NoSuchMethodException e) {
    3232        } catch (Exception e) {
    33             throw new PluginException(this, info.name, e);
     33            BugReportExceptionHandler.handleException(new PluginException(this, info.name, e));
    3434        }
    3535    }
     
    4141            return null;
    4242        } catch (Exception e) {
    43             throw new PluginException(this, info.name, e);
     43            BugReportExceptionHandler.handleException(new PluginException(this, info.name, e));
    4444        }
     45        return null;
    4546    }
    4647
     
    5152            // ignore
    5253        } catch (Exception e) {
    53             throw new PluginException(this, info.name, e);
     54            BugReportExceptionHandler.handleException(new PluginException(this, info.name, e));
    5455        }
    5556    }
Note: See TracChangeset for help on using the changeset viewer.