/www/tags/NOV_07_2009/htdocs/users-guide/plugin-implement-services.html
HTML | 25 lines | 24 code | 1 blank | 0 comment | 0 complexity | 55d23c94bc331545540698b3b5e3a54a 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>The services.xml file</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="plugin-implement.html" title="Chapter 18. Implementing a Simple Plugin"><link rel="prev" href="plugin-implement-dockables.html" title="The dockables.xml Window Catalog"><link rel="next" href="plugin-implement-quicknotepad.html" title="The QuickNotepad Class"></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">The services.xml file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="plugin-implement-dockables.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Implementing a Simple Plugin</th><td width="20%" align="right"> <a accesskey="n" href="plugin-implement-quicknotepad.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="plugin-implement-services"></a>The services.xml file</h2></div></div></div><p>A "service" is a mechanism by which one plugin can work with other
- plugins and avoid a bidirectional build-dependency. For example, the XML
- plugin "depends" on Sidekick, but in fact, it is SideKick which creates
- and operates on an object (a <code class="literal">SideKickParser</code>, in fact)
- defined in the XML plugin. In a way, the dependency is
- bidirectional.</p><p>Similarly, the AntFarm plugin defines but does not instantiate a
- <code class="literal">Shell</code> object. It is the Console plugin which creates
- a specific shell for each available service. SideKick and Console use
- the ServiceManager to search for services offered by other
- plugins.</p><p>Here is an example of a service from the XML plugin, which extends
- Sidekick:</p><div class="informalexample"><pre class="programlisting">
- <!DOCTYPE SERVICES SYSTEM "services.dtd">
- <SERVICES>
- <SERVICE CLASS="sidekick.SideKickParser" NAME="xml">
- new xml.parser.SAXParserImpl();
- </SERVICE>
- </SERVICES>
- </pre></div><p>The object it returns tells Sidekick how it can parse files of a
- specific type. The API docs for SideKickParser indicate exactly which
- methods must be implemented in a plugin which offers this service. It
- should be enough information to let Sidekick, which has its own
- dockable, display the tree information in its own view.</p><p>For more information about services, refer to the <a class="ulink" href="../api/org/gjt/sp/jedit/ServiceManager.html" target="_top">ServiceManager</a>
- class API documentation. There, you can find out what the tags and
- attributes mean, as well as how to register and use services.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="plugin-implement-dockables.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="plugin-implement.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="plugin-implement-quicknotepad.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The dockables.xml Window Catalog </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The QuickNotepad Class</td></tr></table></div></body></html>