Changes between Version 13 and Version 14 of DevelopersGuide/DevelopingPlugins


Ignore:
Timestamp:
2007-06-15T00:50:22+02:00 (18 years ago)
Author:
imi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/DevelopingPlugins

    v13 v14  
    1313 * create a new plugin-directory osm/utils/josm/plugins/''yourpluginname''
    1414 * copy an ant script (build.xml) from an other plugin ('''TODO:''' Someone familar with ant could be so nice and setup a template plugin with an almost complete configured ant script and then change this here)
    15  * The important thing of your build script is, that it places two attributes into the MANIFEST.MF of the jar file:
    16    * Plugin-Class points to the main plugin file (see below)
    17    * Plugin-Description gives the description of the plugin visible in the preferences page. Currently, you have to enter some <br> (not <br/>) by yourself (blame Swing ;)
     15 * The important thing of your build script is, that it places some attributes into the MANIFEST.MF of the jar file. See below.
    1816
    1917= The ''Plugin'' class =
     
    6563== Plugin.getPluginDir() ==
    6664If you subclass from the plugin class (see above), then you can call this function to retrieve your plugin directory where you can freely store/read data from. It is located at ~/.josm/plugins/''youpluginname''
     65
     66
     67= The MANIFEST.MF =
     68
     69You have to put some information into the manifest file of your jar. If you use ant, you can set these values within the build.xml file.
     70
     71 '''Plugin-Class'''::
     72   Points to the main plugin file ('''required''')
     73 '''Plugin-Description'''::
     74   Gives the description of the plugin visible in the preferences page. For line breaks, you have to use <br>, ''not'' <br/> (blame Swing ;). ('''required''')
     75 '''Plugin-Author'''::
     76   An Email-Adress of the author of this plugin. This is used in the error report window, if an error is detected within the plugin code (there is a strange heuristic to guess whether an exception comes from a plugin).
     77 '''Plugin-Early'''::
     78   Can be set to {{{true}}}, in which case the plugin is loaded as early as possible, more specific before the GUI classes are loaded. This is usefull if your plugin alters the GUI or the JOSM-startup process in any way.
     79 '''Plugin-Stage'''::
     80   An number of the order relative to other plugins, when the plugin is loaded. Smaller numbers gets loaded first, so if you have conflicts with other plugins, you can increase or decrease this number to get some control on the loading order. Defaults to 50.
     81 '''Class-Path'''::
     82   An space-seperated list of additional classpaths your plugin wants to use when looking for ressources and classes. The plugin itself is added automatically. Don't forget to provide the additional jar's as well, if you add dependencies here.
     83
     84
     85= Legal stuff (Imis opinion) =
     86
     87Just because I have been asked: JOSM is licensed under GPL and if any code is a "derived work" of JOSM, then it has to be under GPL too. It is my believe, that any JOSM-Plugin is a derived work of JOSM, so GPL is the only possible license for a JOSM-Plugin. If you want to include non-GPL code into a plugin, it has to be seperated from the classes that use JOSM. "Use" as in "import org.openstreetmap.josm...". See the 'Class-Path' - MANIFEST.MF attribute for a way to include other jar files.