|
|
Contents |
Command Line GenerationUsually its not necessary to run the Java code generator from command-line because the Java code is automatically generated and updated while editing a form in JFormDesigner. However in rare cases it is useful to re-generate the Java code of JFormDesigner forms. E.g. if you want upgrade to JGoodies FormLayout 1.2, which introduced a new much shorter syntax for encoded column and row specifications. RequirementsYou need an installation of the JFormDesigner stand-alone edition. If you usually use one of the IDE editions, then simply download the stand-alone edition and install it. PreferencesThe command-line Java code generator uses the preferences store of the stand-alone edition. If you use one of the IDE editions of JFormDesigner, you have to start the stand-alone edition and set the necessary preferences for the code generation. To transfer JFormDesigner preferences from an IDE to the stand-alone edition, you can use the Import and Export buttons in the Preferences dialogs. Make sure that the Code Style preferences are correct because they are not transfered from a IDE. Command Line SyntaxLaunch the code generator as follows, where [ ] means optional arguments and arguments in italics must be provided by you. java -classpath <jfd-install>/lib/JFormDesigner.jar
Using custom componentsIf you're using custom components (JavaBeans) in your forms, it is necessary to tell the code generator the classpath of your components, because the code generator needs to load the classes of custom components. There are two options to specify the classpath for your custom components:
ExamplesGenerate code for a single form: cd C:\MyProject Generate code for all forms in a project that use custom components: cd C:\MyProject AntAlthough we don't provide a special task for Ant, it is easy to invoke the JFormDesigner Java code generator from an Ant script. The <classpath> element makes it easy to specify JARs and folders of custom components. <property name="jfd-install-dir"
value="C:/Program Files/JFormDesigner"/> |