Changes between Version 31 and Version 32 of DevelopersGuide/DevelopingPlugins


Ignore:
Timestamp:
Nov 7, 2009 11:01:59 PM (4 years ago)
Author:
stoecker
Comment:

Remove old text

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/DevelopingPlugins

    v31 v32  
    101101For SVN managed plugins, the links to old versions and the translation texts are automatically added to the [http://josm.openstreetmap.de/plugin plugin information], so JOSM can use that in plugin dialog. 
    102102 
    103 = Versioning and Dependencies = 
    104 JOSM does not support declarative dependency checking - you have to do it by hand. But don't be scared, it's not that hard. You can request information about other installed plugins via {{{PluginInformation.getLoaded("pluginname")}}}. As example if your plugin is named "secondwaltz" and you depend on the plugin "schostakowitsch" to be loaded, do the following things: 
    105  
    106  - make sure you get loaded after "schostakowitsch" (by incrementing your Plugin-Stage. See above) 
    107  - check for "schostakowitsch" to be loaded in your plugin's class constructor: 
    108 {{{ 
    109 #!java 
    110 class SecondWaltz { 
    111  
    112   // constructor called by JOSM to initialize the plugin 
    113   public SecondWaltz() { 
    114     PluginInformation schostakowitsch = PluginInformation.getLoaded("schostakowitsch"); 
    115     if (schostakowitsch == null || !"2".equals(schostakowitsch.version)) { 
    116       JOptionPane.showMessageDialog(Main.parent, tr("Please install plugin 'schostakowitsch' version 2")); 
    117       return; 
    118     } 
    119      
    120     // initialize the plugin 
    121     ... 
    122   } 
    123  
    124 } 
    125 }}} 
    126  - Of course, you may initialize the parts of your plugin that don't need "schostakowitsch" to be loaded or react in some other way to the missing plugin (e.g. by using a build-in version of "schostakowitsch"). 
    127  
    128  
    129103= Updating the plugin = 
    130104