27.7. Customizing the Templates

The classes generated in the previous examples are done so by means of JET (Java Emitter Templates), which is part of the EMF (Eclipse Modeling Framework). The templates that generate the classes are located in the /resources/flexbuilder/templates folder. These include:

  • Controller.asjet

  • Event.asjet

  • Command.asjet

The Cairngorm Plug-in locates the templates through the project's association to a Cairngorm location. It reads the config file (resources/flexbuilder/cairngorm.xml) to get the template to use.

If you want to change the style of the generated code you can modify the existing templates, or better yet create new ones and update cairngorm.xml. The format used by JET is very similar to the JSP (Java Server Pages) syntax.

The specifics of editing these templates are beyond the scope of this book. Should you be interested in learning more about how to edit Java Emitter Templates, you can check out these tutorials:

Get Professional Cairngorm™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.