IntelliJ Community . IntellijPluginDocumentation

 
IntellijPluginDocumentation 

HOME INDEX SEARCH CHANGES GO  
This is the documentation that comes with IDEA... written by the Intellij folks... I think this is a good place for it... someone can remove it if not smile

See also: PluginDocumentation


IDEA Plugins

Purpose

Plug-ins are the only possible way to extend IDEA functionality for third-parties. Every plug-in uses API exposed by IDEA or other plug-ins to implement its functionality. This document is focused on plug-in system architecture and plug-in lifecycle. It doesn?t specify any of the other APIs which may be used by plug-ins.

Plug-In content

Each plug-in should consist of one .jar file placed in IDEA_HOME/plugins/. The archive should contain configuration file (META-INF/plugin.xml) and classes which implement the plug-in functionality. Configuration file specifies plug-in name, description, version, vendor, IDEA version plug-in is supposed to be used with, plug-in components, actions and action groups, action user interface placement.

Plug-In Components

Components are the fundamental concept of plug-ins integration. There are 2 kinds of components: application-level and project-level. Application-level components are created and initialized at IDEA start-up. Project-level components are created for every project present in IDEA (please note, that components are created for even unopened projects). Application-level component can be acquired from Application with getComponent(Class) method. Project-level component can be acquired from Project with getComponent(Class) method.

Every component should have interface and implementation classes specified in the configuration file. The interface file will be used for retrieving the component from the other ones and the implementation class will be used for component implementation.

Application Level Components

Application-level component's interface class should extend the ApplicationComponent interface. Implementation class should have public default constructor, which will be used for its instantiation.

Project Level Components

Project-level component's interface class should extends the ProjectComponent interface. Implementation class should have public default constructor.

Plug-in Components Lifecycle

Currently the lifecycle of component is very simple: component is created and it’s configuration is read. Project-level component is disposed on project close. Jacques Morel has posted an example in the plugin forum that is quite useful to understand the lifecycle of a component.

Plug-in Components Configuration

Every component’s state will be saved & loaded int xml file with plug-in’s name in IDEA_HOME/config/plugins folder if component implements JDOMExternalizableInterface. Component should be ready to save its state almost at any moment.

Plug-In Actions

Each plug-in can contribute a number of actions to the IDEA user interface. All actions should be specified in configuration file.

User Interface Action Placement

The configuration file also specifies action placement in UI. Plug-in vendor can place actions into main menu, pop-up menus and toolbar. See configuration file example for details.

Plugin configuration (plugin.xml)

<idea-plugin>
    <name>VssIntegration</name>
    <description>Vss integration plug-In</description>
    <version>1.0</version>
    <vendor>Foo Inc.</vendor>
    <idea-version min=?3.0? max=?3.1?/>

    <application-components>
        <component>
            <interface-class>com.foo.Component1Interface</interface-class>
            <implementation-class>com.foo.Component1Impl</implementation-class>
        </component>
    </application-components>

    <project-components>
        <component>
            <interface-class>com.foo.Component2</interface-class>
        </component>
    </project-components>

</idea-plugin>

Folders structure

Every plugin should be placed to the IDEA_HOME\plugins folder. It may be in jar or just a folder.

Plugin is in jar:

IDEA_HOME
Plugins Sample.jar/ com.intellij..... ... ... META-INF plugin.xml


Plugin is a folder:

IDEA_HOME
Plugins Sample lib classes com.intellij..... ... ... META-INF plugin.xml

Classes and lib folders are automatically added to the classpath.

Components notation

Components should be named in plugin_name.component_name form. The name of component is returned by it's getComponentName() method.

Document by -

SomeoneAtIntellij?

Post by -

-- DanBachelder - 19 Jun 2002

e d i t a t t a c h r e f - b y d i f f s m o r e
Have ideas, requests, problems regarding this site? Send feedback.
Copyright © 2000-2003 by the contributing authors. All materials at intellij.org are the property of the contributing authors.