intellij-sdk-code-samples/basics/plugin_structure/plugin_configuration_file.html
2016-01-14 19:38:06 -08:00

219 lines
13 KiB
HTML

<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Plugin Configuration File - plugin.xml / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij/sdk/docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij/sdk/docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij/sdk/docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij/sdk/docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij/sdk/docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij/sdk/docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij/sdk/docs/favicon.png">
<link rel="stylesheet" href="/intellij/sdk/docs/styles/styles.css"></head>
<body data-id="basics/plugin_structure/plugin_configuration_file">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Plugin Configuration File - plugin.xml</h1>
<p>The following is a sample plugin configuration file. This sample showcases and describes all elements that can be used in the plugin.xml file.</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_xml"><span class="c">&lt;!-- url="" specifies the URL of the plugin homepage (displayed in the Welcome Screen and in "Plugins" settings dialog) --&gt;</span>
<span class="nt">&lt;idea-plugin</span> <span class="na">url=</span><span class="s">"http://www.jetbrains.com/idea"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Plugin name --&gt;</span>
<span class="nt">&lt;name&gt;</span>VssIntegration<span class="nt">&lt;/name&gt;</span>
<span class="c">&lt;!-- Unique identifier of the plugin.
Cannot be changed between the plugin versions.
If not specified, assumed to be equal to &lt;name&gt;. --&gt;</span>
<span class="nt">&lt;id&gt;</span>VssIntegration<span class="nt">&lt;/id&gt;</span>
<span class="c">&lt;!-- Description of the plugin. --&gt;</span>
<span class="nt">&lt;description&gt;</span>Vss integration plugin<span class="nt">&lt;/description&gt;</span>
<span class="c">&lt;!-- Description of changes in the latest version of the plugin.
Displayed in the "Plugins" settings dialog and in the
plugin repository Web interface. --&gt;</span>
<span class="nt">&lt;change-notes&gt;</span>Initial release of the plugin.<span class="nt">&lt;/change-notes&gt;</span>
<span class="c">&lt;!-- Plugin version --&gt;</span>
<span class="nt">&lt;version&gt;</span>1.0<span class="nt">&lt;/version&gt;</span>
<span class="c">&lt;!-- The vendor of the plugin.
The optional "url" attribute specifies the URL of the vendor homepage.
The optional "email" attribute specifies the e-mail address of the vendor.
The optional "logo" attribute specifies the path within the plugin JAR
to a 16x16 icon to be displayed next to the plugin name in the welcome screen. --&gt;</span>
<span class="nt">&lt;vendor</span> <span class="na">url=</span><span class="s">"http://www.jetbrains.com"</span> <span class="na">email=</span><span class="s">"support@jetbrains.com"</span> <span class="na">logo=</span><span class="s">"icons/plugin.png"</span><span class="nt">&gt;</span>Foo Inc.<span class="nt">&lt;/vendor&gt;</span>
<span class="c">&lt;!-- The unique identifiers of the plugins on which this plugin depends. --&gt;</span>
<span class="nt">&lt;depends&gt;</span>MyFirstPlugin<span class="nt">&lt;/depends&gt;</span>
<span class="c">&lt;!-- Optional dependency on another plugin.
If the plugin with the "MySecondPlugin" ID is installed,
the contents of mysecondplugin.xml (the format of this file
conforms to the format of plugin.xml) will be loaded. --&gt;</span>
<span class="nt">&lt;depends</span> <span class="na">optional=</span><span class="s">"true"</span> <span class="na">config-file=</span><span class="s">"mysecondplugin.xml"</span><span class="nt">&gt;</span>MySecondPlugin<span class="nt">&lt;/depends&gt;</span>
<span class="c">&lt;!-- Allows a plugin to integrate its help system (in JavaHelp format)
with the IDEA help system. The "file" attribute specifies the name
of the JAR file in the "help" subdirectory of the plugin directory.
The "path" attribute specifies the name of the helpset file within
the JAR file.--&gt;</span>
<span class="nt">&lt;helpset</span> <span class="na">file=</span><span class="s">"myhelp.jar"</span> <span class="na">path=</span><span class="s">"/Help.hs"</span> <span class="nt">/&gt;</span>
<span class="c">&lt;!-- Minimum and maximum build of IDEA compatible with the plugin --&gt;</span>
<span class="nt">&lt;idea-version</span> <span class="na">since-build=</span><span class="s">"3000"</span> <span class="na">until-build=</span><span class="s">"3999"</span><span class="nt">/&gt;</span>
<span class="c">&lt;!-- Resource bundle from which the text of plugin descriptions,
action names and etc. will be loaded --&gt;</span>
<span class="nt">&lt;resource-bundle&gt;</span>messages.MyPluginBundle<span class="nt">&lt;/resource-bundle&gt;</span>
<span class="c">&lt;!-- Plugin's application components --&gt;</span>
<span class="nt">&lt;application-components&gt;</span>
<span class="nt">&lt;component&gt;</span>
<span class="c">&lt;!-- Component's interface class --&gt;</span>
<span class="nt">&lt;interface-class&gt;</span>com.foo.Component1Interface<span class="nt">&lt;/interface-class&gt;</span>
<span class="c">&lt;!-- Component's implementation class --&gt;</span>
<span class="nt">&lt;implementation-class&gt;</span>com.foo.impl.Component1Impl<span class="nt">&lt;/implementation-class&gt;</span>
<span class="nt">&lt;/component&gt;</span>
<span class="nt">&lt;/application-components&gt;</span>
<span class="c">&lt;!-- Plugin's project components --&gt;</span>
<span class="nt">&lt;project-components&gt;</span>
<span class="nt">&lt;component&gt;</span>
<span class="c">&lt;!-- Interface and implementation classes are the same --&gt;</span>
<span class="nt">&lt;interface-class&gt;</span>com.foo.Component2<span class="nt">&lt;/interface-class&gt;</span>
<span class="c">&lt;!-- If the "workspace" option is set "true", the component
saves its state to the .iws file instead of the .ipr file.
Note that the &lt;option&gt; element is used only if the component
implements the JDOMExternalizable interface. Otherwise, the
use of the &lt;option&gt; element takes no effect. --&gt;</span>
<span class="nt">&lt;option</span> <span class="na">name=</span><span class="s">"workspace"</span> <span class="na">value=</span><span class="s">"true"</span> <span class="nt">/&gt;</span>
<span class="c">&lt;!-- If the "loadForDefaultProject" tag is present, the project component is instantiated also for the default project. --&gt;</span>
<span class="nt">&lt;loadForDefaultProject&gt;</span>
<span class="nt">&lt;/component&gt;</span>
<span class="nt">&lt;/project-components&gt;</span>
<span class="c">&lt;!-- Plugin's module components --&gt;</span>
<span class="nt">&lt;module-components&gt;</span>
<span class="nt">&lt;component&gt;</span>
<span class="nt">&lt;interface-class&gt;</span>com.foo.Component3<span class="nt">&lt;/interface-class&gt;</span>
<span class="nt">&lt;/component&gt;</span>
<span class="nt">&lt;/module-components&gt;</span>
<span class="c">&lt;!-- Actions --&gt;</span>
<span class="nt">&lt;actions&gt;</span>
<span class="nt">&lt;action</span> <span class="na">id=</span><span class="s">"VssIntegration.GarbageCollection"</span> <span class="na">class=</span><span class="s">"com.foo.impl.CollectGarbage"</span> <span class="na">text=</span><span class="s">"Collect _Garbage"</span> <span class="na">description=</span><span class="s">"Run garbage collector"</span><span class="nt">&gt;</span>
<span class="nt">&lt;keyboard-shortcut</span> <span class="na">first-keystroke=</span><span class="s">"control alt G"</span> <span class="na">second-keystroke=</span><span class="s">"C"</span> <span class="na">keymap=</span><span class="s">"$default"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/action&gt;</span>
<span class="nt">&lt;/actions&gt;</span>
<span class="c">&lt;!-- Extension points defined by the plugin.
Extension points are registered by a plugin so that other
plugins can provide this plugin with certain data. The
"beanClass" attribute specifies the class the implementations
of which can be used for the extension point. --&gt;</span>
<span class="nt">&lt;extensionPoints&gt;</span>
<span class="nt">&lt;extensionPoint</span> <span class="na">name=</span><span class="s">"testExtensionPoint"</span> <span class="na">beanClass=</span><span class="s">"com.foo.impl.MyExtensionBean"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/extensionPoints&gt;</span>
<span class="c">&lt;!-- Extensions which the plugin adds to extension points
defined by the IDEA core or by other plugins.
The "defaultExtensionNs " attribute must be set to the
ID of the plugin defining the extension point, or to
"com.intellij" if the extension point is defined by the
IDEA core. The name of the tag within the &lt;extensions&gt;
tag matches the name of the extension point, and the
"implementation" class specifies the name of the class
added to the extension point. --&gt;</span>
<span class="nt">&lt;extensions</span> <span class="na">xmlns=</span><span class="s">"VssIntegration"</span><span class="nt">&gt;</span>
<span class="nt">&lt;testExtensionPoint</span> <span class="na">implementation=</span><span class="s">"com.foo.impl.MyExtensionImpl"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/extensions&gt;</span>
<span class="nt">&lt;/idea-plugin&gt;</span>
</code></pre>
<div class="last-modified">
Last modified: 23 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij/sdk/docs/app/js/main.build" data-baseurl="/intellij/sdk/docs/" src="/intellij/sdk/docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>