I have recently started using an nifty utility called Flex Formatter. I saw a blog post about it on Grant Skinner’s blog. I was initially skeptical that it wouldn’t to much more than what the formatter in FDT is capable of. I was wrong. It does a lot more than the FDT formatter. Unfortunately I could not install the plugin the way which Grant described in this post (which is the normal way of installing plugins in Eclipse). Instead I had to download the jar files and stick them in the plug-ins folder for Eclipse. If you go Christophe Herreman’s blog, he provides a link to the jar files. Once you download them (there are 3 .jar files in the zip), move them into the plug-ins folder where you have your Eclipse installation. Once you restart Eclipse, you will see the Flex Formatter buttons at the top of Eclipse. Then you can go into preferences and start editing how you like to format your code.
It is quite powerful. It has a lot more features than the formatter that comes with FDT. One of the things I like is that it can rearrange all my methods and properties of my class (in ActionScript classes) so they are in alphabetical order. And it arranges them together by public, protected, internal, and private. It’s pretty sweet. It also formats your mxml files. This ability didn’t exist in Flex Builder or FDT.
But there is a downside. Flex Formatter is a bit frustrating sometimes. For some reason it doesn’t always work. Specifically on some of my custom ActionScript classes. When I try to format, it won’t do anything. I am using PureMVC in my projects and when I try to format any Mediator or Proxy classes that it does not want to work. So the work around I do is copy the code into a new class and format it, copy the formatted code, paste it back into my original class, and delete the new class. This is a pain, but it works. Has anyone else run into this problem?
Tags: flash, flex

- Team Fortress 2
- Assassins Creed 2
- Assassins Creed 2
- Poker
- Left 4 Dead 2
- Uncharted 2
- Serious Sam
- Fly Squirrel Fly
- Left 4 Dead 2
Hi, thanks for the writeup. However, I was unaware of the problem you mentioned. Please report problems at: http://sourceforge.net/tracker/?group_id=248408&atid=1126569 (requires sourceforge account) or send me a note with the details. For your particular problem, I’m not sure what’s going on. Have you looked in the Eclipse error log/view? If there is an exception of some kind that is unhandled, the errors end up there.
Hello Ernest,
Sorry for the late response. The issue I described above happens when I try to format certain custom classes. Specifically my Mediator and Proxy classes which are associated with the PureMVC framework. Other than that, it works great.
Scott,
If you can, please send me a code sample that fails and I’ll take a look. If it’s an easy fix, then I’ll get it into the next release.
ernestpasour@users.sourceforge.net