Substance look and feel - plugins

Starting from version 2.1, Substance provides support for third-party components (for example NetBeans tabs) using plugin architecture.

Creating a plugin

Substance plugin is a jar file that contains at least the following two files: The structure of META-INF/substance-plugin.xml descriptor is:
  <substance-plugin>
    <plugin-class>Class name</plugin-class>
  </substance-plugin>
The class name is a fully qualified name of a non-abstract class with a default zero-argument constructor that implements the org.jvnet.lafplugin.LafPlugin interface.

The LafPlugin interface specifies the following four functions which must be implemented by the plugin: Note that the plugin jar doesn't have to contain the UI delegates that are specified in its getUiDelegates function, as long as they are somewhere in the classpath.

Built-in plugin

Substance comes bundled with a built-in plugin for a color chooser (from Quaqua look and feel). The corresponding files are: See the implementation of the BasePlugin class for the reference.

Using third-party plugins

In order to use a third-party plugin, just put it in the classpath (along with the substance.jar) and it will be picked up automatically.