How Plugins are Loaded

We will discuss the implementation of the QuickNotepad plugin, along with the jEdit APIs it makes use of. But first, we describe how plugins are loaded.

As part of its startup routine, jEdit's main method calls various methods to load and initialize plugins.

Additionally, plugins using the jEdit 4.2 plugin API can be loaded and unloaded at any time. This is a great help when developing your own plugins -- there is no need to restart the editor after making changes (see the section called “Reloading the Plugin” ).

Plugins are loaded from files with the .jar filename extension located in the jars subdirectories of the jEdit installation and user settings directories (see the section called “The jEdit Settings Directory”).

For each JAR archive file it finds, jEdit scans its entries and performs the following tasks:

After scanning the plugin JAR file and loading any resources, a new instance of the plugin core class is created and added to the collection maintained by the appropriate PluginJAR. jEdit then calls the start() method of the plugin core class. The start() method can perform initialization of the object's data members. Because this method is defined as an empty no-op in the EditPlugin abstract class, a plugin need not provide an implementation if no unique initialization is required.