|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.sp.jedit.EditPlugin
The abstract base class that every plugin must implement.
Each plugin must have the following properties defined in its property file:
plugin.class name.name
plugin.class name.version
plugin.class name.jars
- only needed if your plugin
bundles external JAR files. Contains a whitespace-separated list of JAR
file names. Without this property, the plugin manager will leave behind the
external JAR files when removing the plugin.plugin.class name.author
plugin.class name.docs
- the path to plugin
documentation in HTML format within the JAR file.plugin.class name.depend.
followed by a number.
Dependencies must be numbered in order, starting from zero.The value of a dependency property has one of the following forms:
jdk minimum Java version
jedit minimum jEdit version
- note that this must be a
version number in the form returned by jEdit.getBuild()
,
not jEdit.getVersion()
.plugin plugin version
- the fully quailified
plugin class name must be specified.plugin.QuickNotepadPlugin.name=QuickNotepad plugin.QuickNotepadPlugin.author=John Gellene plugin.QuickNotepadPlugin.version=4.1 plugin.QuickNotepadPlugin.docs=QuickNotepad.html plugin.QuickNotepadPlugin.depend.0=jedit 04.01.01.00Note that in all cases above where a class name is needed, the fully qualified class name, including the package name, if any, must be used.
Alternatively, instead of extending this class, a plugin core class can
extend EBPlugin
to automatically receive EditBus messages.
jEdit.getProperty(String)
,
jEdit.getPlugin(String)
,
jEdit.getPlugins()
,
jEdit.getPluginJAR(String)
,
jEdit.getPluginJARs()
Nested Class Summary | |
static class |
EditPlugin.Broken
A placeholder for a plugin that didn't load. |
static class |
EditPlugin.JAR
A JAR file. |
Constructor Summary | |
EditPlugin()
|
Method Summary | |
void |
createMenuItems(java.util.Vector menuItems)
When a View object is created, it calls this
method on each plugin class to obtain entries to be displayed
in the view's Plugins menu. |
void |
createOptionPanes(OptionsDialog optionsDialog)
When the Global Options dialog is opened, this method is called for each plugin in turn. |
java.lang.String |
getClassName()
Returns the plugin's class name. |
EditPlugin.JAR |
getJAR()
Returns the JAR file containing this plugin. |
void |
start()
The jEdit startup routine calls this method for each loaded plugin. |
void |
stop()
The jEdit exit routine calls this method fore ach loaded plugin. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EditPlugin()
Method Detail |
public void start()
The default implementation does nothing.
public void stop()
The default implementation does nothing.
public void createMenuItems(java.util.Vector menuItems)
View
object is created, it calls this
method on each plugin class to obtain entries to be displayed
in the view's Plugins menu.
The menuItems
vector accumulates menu items and
menus as it is passed from plugin to plugin.
The easiest way to provide menu items is to
package them as entries in the plugin's property
file and implement createMenuItems()
with a
call to the GUIUtilities.loadMenu(String)
method:
public void createMenuItems(Vector menuItems) { menuItems.addElement(GUIUtilities.loadMenu( "myplugin.menu")); }Alternatively,
GUIUtilities.loadMenuItem(String)
can
be used if your plugin only defines one menu item.The default implementation does nothing.
menuItems
- Add menus and menu items here.GUIUtilities.loadMenu(String)
,
GUIUtilities.loadMenuItem(String)
public void createOptionPanes(OptionsDialog optionsDialog)
createOptionPane()
as follows:
public void createOptionPanes(OptionsDialog optionsDialog) { dialog.addOptionPane(new MyPluginOptionPane()); }Plugins can also define more than one option pane, grouped in an "option group". See the documentation for the
OptionGroup
class for information.The default implementation does nothing.
optionsDialog
- The plugin options dialog boxOptionPane
,
AbstractOptionPane
,
OptionsDialog.addOptionPane(OptionPane)
,
OptionGroup
,
OptionsDialog.addOptionGroup(OptionGroup)
public java.lang.String getClassName()
public EditPlugin.JAR getJAR()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |