Archive for February, 2009

A Flex formatter

I use the Flex Builder plug-in on top of Eclipse for Flex development . When it comes to coding in Flex, I often find myself missing all of those subtle but priceless options that Eclipse’s Java editor has, like the code formatting, code templates, commenting style or the all-mighty “Save Actions” option which automatically performs specific actions whenever you save your code.

I’ve recently started working on a project with an existing codebase, out of which 90% is Flex code. Facing the possibility of applying our team’s coding guidelines to countless lines of Flex code that I would have to modify, I turned to my browser and began a frantic search for something that would help. I came across a small project aiming to provide exactly what I needed : Flex formatting options. The project is called Flex Formatter and it can be found at  http://sourceforge.net/projects/flexformatter/ on good ol’ Sourceforge. It provides a set of formatting options for ActionScript and MXML code which may cover some of the common needs of any Flex developer out there.

To install it, I downloaded the latest version (0.6.7 at the time of this writing) from Sourceforge, in the form of a jar file. I copied the jar in Eclipse’s plugins folder and restarted Eclipse.

After restarting Eclipse, a new item called Flex Formatting appeared in Eclipse’s Preferences window, with options for ActionScript and MXML indenting and code formatting. I found particularly useful the indentation and the text wrapping options. Once I decided on the rules I wanted, I clicked ‘Apply’ to save my changes. Back in Eclipse’s main toolbar, 2 new buttons have appeared : Format Flex code (selected lines) and Indent Flex code (selected lines). The first will apply the rules you have specified on any Flex code selection (including indentation), while the second button will only properly indent the Flex code selection.

Another interesting option of this small tool is the possibility to export the rules to a file and import them later. This can be done from the same Flex Formatting item in Eclipse’s Preferences window. Exporting & importing make it easier for team members to share their coding style options. One team member could create the rules, export them to a file and put the file on a versioning server. The rest of the team could then retrieve the file from the versioning server and import it in Eclipse.

The formatter is far from complete. In its current version (0.6.7), it lacks some options like performing the formatting on save and it could also do with a more fine-grained set of formatting options. However, after just a couple of days of using it, this tool has saved me a lot of time and energy and I think it is definitely worth using it and I would recommend it to any Flex developer. Just try it, it won’t bite. It just flexes.

, , ,

4 Comments

downloadable adobe flash player 8 Buy SoundBooth CS4 adobe photoshop customer service adobe creative suite academic license Buy After Effects CS4 adobe photoshop for mac os torrent adobe illustrator web design library Buy Creative Suite 4 Master Collection copyright adobe photoshop 7 book adobe photoshop cs2 Buy Creative Suite 4 Web Premium adobe indesign cs2 torrent do not want adobe flash player Buy Dreamweaver CS3 adobe after effects cd adobe photoshop will not uninstall Buy Dreamweaver CS4 adobe photoshop elements 1.0 le release adobe photoshop and business cards Buy Adobe Fireworks CS4 adobe photoshop 7.0 serial code adobe flash programming tablet pen usage Buy Flash CS3 Professional adobe photoshop cs3 crack adobe after effects visually book Buy Flash CS4 Professional adobe premiere pro 1.5 crackz flash adobe occasion Buy Illustrator CS4 creating a city adobe after effects adobe premiere pack Buy InDesign CS3 adobe photoshop trial extension adobe premiere elements 2.0 export mov Buy InDesign CS4 adobe photoshop elements 2.0 driver update adobe photoshop style layer effects series Buy Photoshop CS3 Extended xp sp2 adobe flash problem download adobe after effects 6.5 pro Buy Premiere Pro CS4 adobe flash player8