1. Gas3 Eclipse Builder

Installation

Download org.granite.builder_2.0.0.GA.jar and drop it in your Eclipse plugins directory, making sure to remove any older versions. Then, restart Eclipse.

Adding the GraniteDS Nature & Configuration Wizard

The Add GraniteDS Nature is available for any opened Java project. When you want to use the builder with your Java project, right-click on the project in your Eclipse package explorer and select Add GraniteDS Nature:

This action should launch a configuration wizard, whose first step is to select Java source folders for which you code generation (i.e., ActionScript3 beans that mirror your JavaBeans):

You may select as many Java source folders as you want and configure specific filters and output directories for each of them. Just select one of the Included, Excluded, or Output subnodes and click on the Edit button.

For inclusion/exclusion patterns, the syntax is similar to the Ant include/exclude ones in fileset and the following rules apply:

  • If you do not configure any exclusion and inclusion patterns, all Java classes in the folder are used for the generation.
  • If a class is matched by an exclusion pattern, it will be ignored even if it is matched by another inclusion pattern.

In the example, **/*Service*.java will match any Java class that contains the Service string in its name in any subdirectory.

For each selected Java source folder you may also configure specific output directories:

  • Output Directory: A directory relative to your project directory where generated ActionsScript3 classes are put.
  • Base Output Directory: An optional directory relative to your project directory where so-called "Base" generated ActionsScript3 classes are put. If left empty, the output directory above is used for both "Base" and inherited ActionScript3 classes. See here for this distinction.

The next step in the wizard allows your Java project dependencies. This is required when your Java classes make references to other classes declared in other Java projects. Clicking on the Add project button will open a dialog that lists all other opened Java projects:

The next step is classpath configuration. If you do not use any custom classes in the Options panel you do not need to change anything here since the classpath is automatically configured with your current selected source folders. In the following picture, the helloworld2/bin directory, where Eclipse compiles your Java source, is preselected, as well as all libraries in the build path, such as ejb3-persistence.jar and jboss-ejb3x.jar:

The next panel lets you configure custom generation templates. Those templates are a mix of the JSP syntax and the Groovy language. If you need specific code generation, you may write your own template, select one template in the displayed tree, and click on the Edit button:

In the above example, a class: protocol is used because all standard templates are available in the classpath. Alternatively, you may use the file: protocol to load your template from the filesystem.

Clicking the Tide button will configure Tide specific templates for entity beans. Use it if you are configuring the builder for a Tide project.

The last panel lets you configure various options:

From the top to the bottom:

  • UID Property Name: If you want your AS3 to implement mx.core.IUID, you must tell the generator the name of the Java field that contains this UID; use the same name in all your beans. Default is to search for field named uid.
  • AS3TypeFactory Class: You may use this option to configure a custom factory for special type support. See Type Conversions for a detailed example. If you configure this, you must add your class in the Classpath panel.
  • Transfomer Class: This is for very advanced use only and, as such, is not documented
  • Package Translators: You may use this option if you need Gas3 to generate your AS3 beans with other packages than Java ones. See here for details.
  • "Show debug informations in console": If enabled, Gas3 will display more information during the generation process.

When you have finished with the wizard, a first generation process will start and you should see something like this in the Eclipse console:

 

The GraniteDS Project Properties Panel

When you need to change your configuration later, you may right-click on your project, select the Properties item, and you'll be able to modify all GraniteDS Eclipse Builder configuration options:

The panels are exactly the same as those of the wizard and the above documentation applies.

Using the GraniteDS Builder Together with Flex Builder

You may use GraniteDS builder with Flex Builder provided that the three builders (Java, Granite, and Flex) are configured in the correct order. It will be ok if you create a Java project, add the Flex project nature, and then the GraniteDS nature; the builder will make sure that builders are set up in the correct order. Otherwise, you may have to change this order. Right-click on your project, select the Properties item, and select the Builders entry:

The order (Java / Granite / Flex) in the above picture is the correct one.

Removing the GraniteDS Nature

When you have configured your project to use the GraniteDS Eclipse Builder, you may cancel any further generation processes by removing the nature:

Note that the hidden configuration file .granite in your project is not removed by this action and you must delete it manually. Otherwise, it will be reused whenever you add the nature again.


Browse Space

- Pages
- Blog
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

Other Features

Add Content

- Add Comment


SourceForge.net Logo
Copyright © 2007-2010 Adequate Systems. All Rights Reserved.