org.uispec4j.extension
Class ExtensionGenerator
java.lang.Object
org.uispec4j.extension.ExtensionGenerator
public class ExtensionGenerator
- extends java.lang.Object
Provides a means for extending UISpec4J to support user-defined components.
This class offers a main() function which generates a JAR file containing extended
versions of some UISpec4J classes (for instance Panel).
This JAR file is intended to be placed before the UISpec4J JAR in your classpath.
Arguments:
<path> <name:class> <name:class> ...
where:
<output> is the path of the JAR file to be generated
- each
<name:class> defines an extension, where:
name is the name of the component to be integrated
class is the name of the component class
For instance:
java -cp ... org.uispec4j.extension.ExtensionGenerator lib/uispec_ext.jar Calendar:com.xxx.Calendar
The component class and the associated Swing class must adhere to certain conventions:
- The Calendar class must implement
UIComponent (or better yet extend
AbstractUIComponent)
- The Calendar class must declare a static field TYPE_NAME providing the related type name
- The Calendar class must declare a static field SWING_CLASSES providing the related swing classes
- The Calendar class must provide one public constructor with a JCalendar parameter
- The JCalendar class must extend java.awt.Component
- The given name ("calendar") must not be already used within UISpec4J.
For instance:
public class Calendar extends AbstractUIComponent {
public static final String TYPE_NAME = "calendar";
public static final Class[] SWING_CLASSES = {JCalendar.class};
public Calendar(JCalendar calendar) {
...
}
}
- See Also:
- Adding Custom Components
|
Method Summary |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExtensionGenerator
public ExtensionGenerator()
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2004-2010. All Rights Reserved.