Laf-Plugin - support for third-party components in look-and-feel libraries

The goal of this project is to provide a generic plugin framework for look-and-feels and define the interface of a common kind of plugins - the component plugins.

Look-and-feels that use this library

In addition, the following LAFs have expressed their wish to use laf-plugin in the respective next versions:

Introduction

The main LookAndFeel class instantiates and queries ComponentPluginManager to get the details of third-party UI components. The constructor of PluginManager gets the XML descriptor name. The plugin class LafComponentPlugin contains a number of functions: This way, the base look-and-feel library has no dependencies on third-party components, and can have as many plugins as you wish. Plugin writer must comply with the settings of the particular look-and-feel for XML name and XML tag names. In addition, she must implement the LafComponentPlugin interface with the above functions.

If you are a provider of custom component, you will need to provide the following for each LAF:
  1. XML descriptor.
  2. Class that implements LafComponentPlugin interface.
  3. UI delegate for each custom component.

Using this library in your look-and-feel

The laf-plugin.jar library (in Documents & Files section) contains the runtime classes. You can use the following simple Ant task to put the laf-plugin classes in your main LAF runtime library:
<target name="jar-bin" description="create runtime jar">
  <delete file="${substance.drop.dir}/substance.jar" />
  <unjar src="${substance.drop.dir}/laf-plugin.jar" dest="${substance.output.dir}/"/>
  <jar compress="true" destfile="${substance.drop.dir}/substance.jar" 
        manifest="${substance.src.dir}/META-INF/MANIFEST.MF">
    <fileset dir="${substance.output.dir}/" excludes="test/**" />
    <fileset dir="${module.substance.basedir}/" includes="resources/**" />
  </jar>
</target>
The ComponentPluginManager class provides utility functions for working with the plugins. Here is a sample implementation of a look-and-feel that uses these functions.

Developers

Additional thanks to Patrick Gotthardt of PgsLookAndFeel, Robert Beeger of Squareness and Frederic Lavigne of Skin for valuable suggestions on the proposed approach.

License

The license for this project is BSD. However, this project uses third-party NanoXML Lite XML parser for time and memory efficiency. The license for NanoXML Lite is very much like BSD. In case you wish to obtain fully-BSD version of laf-plugin, you are welcome to open an issue and specify whether you wish to use DOM or SAX parser.