Well Adobe did not provide the Flex Builder or Eclipse SDK plugin with a source code formatter (also known as Pretty Printer). To bad, because I really like nice formatted code. And I put a lot of time in fomatting my code.

Not anymore !!!!

From now on you can start using the Flex Formatter it’s a Flex Pretty Printer Tool.

This is an Eclipse editor tool to provide source code formatting for Adobe Flex code (i.e. Actionscript and MXML). The developer of this eclipse plugin provided a small set of formatting options which hopefully covers the most popular coding conventions.

You can download it here.

Installation is easy.
You should be able to just drop this plugin in the “plugins” dir (or “dropins” dir if you are using Eclipse 3.4 or greater) and restart Eclipse with the -clean argument.

How to use.
Basically, there are two command (format and indent) that have icons on the toolbar.

Select lines and click one or the other. There are some options on a preference page.