| 86 | = Versioning and Dependencies = |
| 87 | 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: |
| 88 | |
| 89 | - make sure you get loaded after "schostakowitsch" (by incrementing your Plugin-Stage. See above) |
| 90 | - check for "schostakowitsch" to be loaded in your plugin's class constructor: |
| 91 | {{{ |
| 92 | #!java |
| 93 | PluginInformation schostakowitsch = PluginInformation.getLoaded("schostakowitsch"); |
| 94 | if (schostakowitsch == null || !"2".equals(schostakowitsch.version)) { |
| 95 | JOptionPane.showMessageDialog(Main.parent, tr("Please install plugin 'schostakowitsch' version 2"); |
| 96 | return; |
| 97 | } |
| 98 | }}} |
| 99 | - 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"). |
| 100 | |
| 101 | |