This is a updated brief explanation about writing plugins for DAVInspector. If you are just looking for a user guide please take a look at the DAVInspector website at <http://davinspector.sourceforge.net/>. This explains what this version of DAVInspector is and how you could add new features to DAVInspector without knowledge of the core program. Just some experiences in java programming are needed.
DAVInspector is developed by employees of the the institution "Simulation and Software Technology" (SISTEC) at the German Aerospace Center DLR.
We are happy about any support for this project - for example you might participate as a developer, bug reporter or simply by telling us your needs. Just visit our forums or join our mailing-lists on Sourceforge.
To build or run DAVInspector you need a Java 2 Runtime Environment (JRE) with a version number 1.5.0 and higher. You can download the JRE for a number of platforms from <http://java.sun.com>. If you want to build DAVInspector you additionally need a recent version of the Jakarta Ant build tool. You can download Ant from <http://jakarta.apache.org>.
public void init(PluginManager pluginManager, PluginDirection direction) { myPlugInDirection = direction; if (myJScrollPane == null) { myJTextPane = new JTextPane(); myJScrollPane = new JScrollPane(); myJScrollPane.setViewportView(myJTextPane); } myJTextPane.setText(""); Util.setUIDesign(); }
To write your own plugin you have to follow some naming conventions. Otherwise DAVInspector is not able to load your plugin. The main class of your plugin has to belong to a package de.dlr.davinspector.plugins.<Main Class>.
So, let's assume to write a plugin named ExampleViewPlugin. The first few lines of code have to look like this:
package de.dlr.davinspector.plugins.exampleviewplugin; import de.dlr.davinspector.common.Util; import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; import de.dlr.davinspector.plugin.PluginManager; public class ExampleViewPlugin implements IViewPlugin { ... }
If you think, you are ready to test your plugin, create a jar file of it named like the main class. In our example that would be ExampleViewPlugin.jar. Copy it to the plugin directory of DAVInspector and start DAVInspector. Now you should see you plugin in the plugin-configuration window.
To make your plugin multilingual, you have to .....
You should use the Logging system of DAVInspector to log debug and error messages. All you have to do is, to create a logging object for each class:
public class ExampleViewPlugin implements IViewPlugin { /** Logger, Apache log4j. */ private static Logger myLogger = Logger.getLogger(ExampleViewPlugin.class); }
Then you can use the five logging methods debug(), info(), warn(), error() and fatal()
For example: logger.debug("This is a debug message");
All messages should appear on stdout / the logging file.