UISpec4J can be extended to support new kinds of UI components, using the following steps:
Please refer to the ExtensionGenerator Javadoc for more information.
The ExtensionGenerator class modifies only the Panel class. It adds two "get" methods to this class - for instance, if you are adding a Calendar component, it will add:
public Calendar getCalendar(String name) throws ComponentNotFoundException { ... } public Calendar getCalendar() throws ComponentNotFoundException { ... }
The extension mechanisms works at the bytecode level, using the ASM library. It parses the Panel class loaded from the classpath, and generates the bytecode in the proper section for the two methods.
For the extension mechanism to work, you will need asm-3.1.jar and asm-util-3.1.jar in your classpath.