/www/tags/NOV_07_2009/htdocs/users-guide/plugin-intro.html
HTML | 58 lines | 58 code | 0 blank | 0 comment | 0 complexity | c20450e5b6a293241694664fd7e2b39c MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 17. Introducing the Plugin API</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="writing-plugins-part.html" title="Part IV. Writing Plugins"><link rel="prev" href="writing-plugins-part.html" title="Part IV. Writing Plugins"><link rel="next" href="plugin-implement.html" title="Chapter 18. Implementing a Simple Plugin"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Introducing the Plugin API</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="writing-plugins-part.html">Prev</a> </td><th width="60%" align="center">Part IV. Writing Plugins</th><td width="20%" align="right"> <a accesskey="n" href="plugin-implement.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="plugin-intro"></a>Chapter 17. Introducing the Plugin API</h2></div></div></div><a class="indexterm" name="id2606459"></a><p>The <em class="firstterm">jEdit Plugin API</em> provides a framework for
- hosting plugin applications without imposing any requirements on the design
- or function of the plugin itself. You could write an application that
- performs spell checking, displays a clock or plays chess and turn it into a
- jEdit plugin. There are currently over 50 released plugins for jEdit. While
- none of them play chess, they perform a wide variety of editing and file
- management tasks.</p><p>A detailed listing of available plugins is available at <a class="ulink" href="http://plugins.jedit.org" target="_top">plugins.jedit.org</a>. You can also find
- beta versions of new plugins in the “<span class="quote">Downloads</span>” area of <a class="ulink" href="http://community.jedit.org" target="_top">community.jedit.org</a>.</p><p>Using the “<span class="quote">Plugin Manager</span>” feature of jEdit, users with
- an Internet connection can check for new or updated plugins and install and
- remove them without leaving jEdit. See <a class="xref" href="using-plugins.html" title="Chapter 9. Installing and Using Plugins">Chapter 9, <i>Installing and Using Plugins</i></a> for
- details.</p><p>Requirements for “<span class="quote">plugging in</span>” to jEdit are as
- follows:</p><div class="itemizedlist"><ul type="disc"><li><p>This plugin must supply information about itself, such as its
- name, version, author, and compatibility with versions of
- jEdit.</p></li><li><p>The plugin must provide for activating, displaying and
- deactivating itself upon direction from jEdit, typically in response
- to user input<sup>[<a name="id2607152" href="#ftn.id2607152" class="footnote">1</a>]</sup>. Make sure you can continue to use both your plugin
- and the editor after it has been reloaded.</p></li><li><p>Each Plugin has an ActionSet defined by jEdit, which is added
- to the main ActionContext. The ActionSet is a container for
- EditAction instances. The plugin may define
- <em class="firstterm">actions</em> in a number of ways. One way is
- explicitly, with an action definition file known as
- <code class="literal">actions.xml</code>. Another is implicitly, by defining
- dockable windows in <code class="literal">dockables.xml</code>.</p><p>Most EditActions are small blocks of BeanShell code that jEdit
- will perform on behalf of the plugin upon user request. They provide
- the “<span class="quote">glue</span>” between user input and specific plugin
- routines.</p><p>By convention, plugins display their available actions in
- submenus of jEdit's <span class="guimenu"><strong>Plugins</strong></span> menu; each menu item
- corresponds to an action. Plugin authors do not define specific
- shortcuts - the user can/will assign EditActions to keyboard
- shortcuts, toolbar buttons, or entries in the text area's Context
- menu (right-click menu).</p></li><li><p>The plugin may, but need not, provide a user interface.</p><p>If the plugin has a visible interface, it can be shown in any
- object derived from one of Java top-level container classes:
- <code class="classname">JWindow</code>, <code class="classname">JDialog</code>, or
- <code class="classname">JFrame</code>. jEdit also provides a dockable window
- API, which allows plugin windows derived from the
- <code class="classname">JComponent</code> class to be docked into views or
- shown in top-level frames, at the user's request.</p><p>Plugins can also act directly upon jEdit's text area. They can
- add graphical elements to the text display (like error highlighting
- in the case of the <span class="application">ErrorList</span> plugin) or
- decorations surrounding the text area (like the
- <span class="application">JDiff</span> plugin's summary views). These
- plugins are dependent on the JEditTextArea class, which is currently
- getting refactored.</p></li><li><p>Plugins may provide a range of options that the user can
- modify to alter their configuration.</p><p>If a plugin provides configuration options in accordance with
- the plugin API, jEdit will make them available in the
- <span class="guilabel"><strong>Global Options</strong></span> dialog box.</p></li><li><p>While it is not required, plugins are encouraged to provide
- documentation.</p></li></ul></div><p>As noted, many of these features are optional; it is possible to write
- a plugin that does not provide actions, configuration options, or dockable
- windows. The majority of plugins, however, provide most of these
- services.</p><div class="sidebar"><p class="title"><b>Plugins and different jEdit versions</b></p><p>As jEdit continues to evolve and improve, elements of the API may
- change with a new jEdit release.</p><p>On occasion an API change will break code used by plugins,
- although efforts are made to maintain or deprecate plugin-related code
- on a transitional basis. While the majority of plugins are unaffected by
- most changes and will continue working, it is a good idea to monitor the
- jEdit change log, and join the <code class="literal">jedit-devel</code> mailing list, to keep updated on changes and bug reports, so that you will know when your
- plugin needs to be updated.
- </p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2607152" href="#id2607152" class="para">1</a>] </sup>You should test your plugin by loading and unloading
- it from both the Plugin Manager, as well as the <span class="bold"><strong>Activator Plugin</strong></span>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="writing-plugins-part.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="writing-plugins-part.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="plugin-implement.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part IV. Writing Plugins </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 18. Implementing a Simple Plugin</td></tr></table></div></body></html>