HelloWorld Wizard

This is a simple wizard that generates a simple txt file. You can choose the output folder and the file name.

The following image shows the Wizard and its XML file. Just take a fast look on it. The Wizard is a "mirror" of the XML file. Just change the XML (add new componenents like textfields, checkbox, radios, etc) and they will appear in the Wizard. The "template" tag defines the Velocity templates used when code generation starts.

How to create this Wizard

To create this HelloWorld wizard you just have to Create two files: hello.xml (wizard configuration file), hello.vm (Velocity template)

Create the hello.xml file:


<?xml version="1.0" encoding="UTF-8"?>
<EclipseWork>
    <wizard>
        <title>HelloWorld EclipseWork</title>

		<!-- First Page -->
        <component-page >
        	<description>Some description here</description>

			<!-- the type can be package or folder -->
			<container name="folder" label="Folder Output: " type="folder" />
			<textfield name="name" label="Name: " />

			<textfield name="message" label="Type some message" />

	</component-page>

		<!-- Templates -->
        <output>
        	<template component="name" velocity="hello.vm" extension="txt" container="folder" />
	</output>
    </wizard>
</EclipseWork>

Create the hello.vm Template:




You typed: $message



Note that the template defines the $message variable. The $message variable has the same name of the TextField in the wizard. Of course, the variable will have the same value typed in the TextField. That's the way EclipseWork put some values in the Velocity Context.

There are a lot of UI compoenentes that you can use (textfield, combo, radio, checkbox, etc).

The "templates" defined in the XML file will be used when the code generation starts. Feel free to use as many templates you want.

You can also add a lot of pages to the wizard, and use the "next" button. Next -> Next -> Next -> Finish



Running the Wizard

To run the wizard just right click in the hello.xml file, and select "EclipseWork -> OpenWizard".

As you realized, EclipseWork hides all the complexity of creating Eclipse wizards. Hope you liked it :-)

Note that you can customize it and create yor own templates and wizards.

This project is in continuing development. Any feedback will be appreciated.