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 (please refer to the dependencies page for a list of specific JARs to be used). It parses the Panel class loaded from the classpath, and generates the bytecode in the proper section for the two methods.