IntelliJ IDEA Plugin
Note: This is work in laboratory and may never become a supported project.
Background
IDEA from JetBrains has a concept of Run Configurations which allows us to set up an environment to run the project in. There are many RunConfiguration types already available, such as Applet, Application, J2ME, JUnit, Plugin etc. However, there is no explicit support for OSGi, and I thought it would be a good addition to support launching OSGi platforms from within IDEA without fondling around with Application or Remote run configurations.
Requirements
Initially I want to support;
- Support for Felix, Knopflerfish and Equinox.
- StartLevels set per bundle.
- Support for Oscar Bundle Repository.
- Support for Eclipse Update Center.
- Support for OSGi Bundle Repository.
- Support for Local Project, i.e. the modules in the opened Idea project.
- Support for Knopflerfish bundle repository (if possible).
- Browsing of Repository, and selections.
- Adding user repositories, including custom types.
- Selection of JDK.
- Setting of System Properties.
- Setting of other VM arguments.
- Clean and GUI feature from console base Pax Runner.
- Support for Proxies to access Repositories.
Later down the road, I have been thinking of;
- Setting of Default StartLevel.
- Change of StartLevel in the running instance.
Development
Environment
The Plugin is developed using IDEA 5.1.2, but will be converted and released as a plugin for Idea 6.0, which is out somewhere towards end of 2006.
To develop IDEA plugins, it is highly recommended to install the DevKit, which can be found on JetBrains website together with additional information for plugin developers.
Operations
The plugin must be a com.intellij.execution.configurations.ConfigurationType and registered in the plugin.xml as an application component.
<!DOCTYPE idea-plugin PUBLIC "Plugin/DTD" "http://plugins.intellij.net/plugin.dtd"> <idea-plugin> <name>Plugin name here</name> <description>short description of the plugin</description> <version>1.0</version> <vendor>YourCompany</vendor> <idea-version since-build="3000"/> <application-components> <component> <implementation-class>org.ops4j.pax.runner.idea.PaxRunnerType</implementation-class> </component> </application-components> </idea-plugin>
The PaxRunnerType is responsible to return an implementation of ConfigurationFactory, and we call that OsgiRunConfigurationFactory, which in turn creates OsgiRunConfiguration template instances on demand.
The OsgiRunConfiguration is the center of gravity, and will be used by both the IDEA framework as well as the forms and other parts of the plugin. It is therefor passed around quite heavily.
The package repositories contains the model for handling the repositories and the bundle information in those repositories. Changes to that model are reported via BundleObserver and RepositoryObserver interfaces. The various UI components will register themselves at the OsgiRunConfiguration as such observers when needed.
The package run contains the runners for each platform.
Screenshots
Main Runner Panel
Add Bundles Panel
On this screenshot, we have the Local Project listed as well as the Oscar Bundle Repository. In OBR, each bundle has a category which is used to classify and group the bundles in that repository.