Ignore:
Timestamp:
2010-01-12T18:27:40+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed an ugly hack in the plugin bootstrap procedure

File:
1 edited

Legend:

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

    r2817 r2830  
    1515
    1616/**
    17  * All plugins *must* have an standard constructor taking no arguments.
    18  *
    19  * This constructor is called at JOSM startup, after all Main-objects have been initialized.
    2017 * For all purposes of loading dynamic resources, the Plugin's class loader should be used
    2118 * (or else, the plugin jar will not be within the class path).
     
    4744     * is a bit hacky, but it works).
    4845     */
    49     public final PluginInformation info = PluginInformation.currentPluginInitialization;
     46    private PluginInformation info = null;
     47
     48    /**
     49     * The no-arg constructor is deprecated.
     50     *
     51     * @deprecated use {@see Plugin(PluginInformation)} instead
     52     */
     53    @Deprecated
     54    public Plugin() {
     55
     56    }
     57    /**
     58     * Creates the plugin
     59     *
     60     * @param info the plugin information describing the plugin.
     61     */
     62    public Plugin(PluginInformation info) {
     63        this.info = info;
     64    }
     65
     66    /**
     67     * Replies the plugin information object for this plugin
     68     *
     69     * @return the plugin information object
     70     */
     71    public PluginInformation getPluginInformation() {
     72        return info;
     73    }
     74
     75    /**
     76     * Sets the plugin information object for this plugin
     77     *
     78     * @parma info the plugin information object
     79     */
     80    public void setPluginInformation(PluginInformation info) {
     81        this.info = info;
     82    }
    5083
    5184    /**
     
    79112     */
    80113    public void copy(String from, String to) throws FileNotFoundException, IOException {
    81         String pluginDirName = Main.pref.getPreferencesDir()+"plugins/"+info.name+"/";
     114        String pluginDirName = Main.pref.getPluginsDirectory() + "/" + info.name + "/";
    82115        File pluginDir = new File(pluginDirName);
    83116        if (!pluginDir.exists()) {
Note: See TracChangeset for help on using the changeset viewer.