Using ColdFusion Builder Extensions and Snippets in Flash Builder

Posted on May 16, 2010

The other day someone asked me whether you could use ColdFusion Builder extensions and/or snippets in Flash Builder. The answer is yes. When you have ColdFusion Builder and Flash Builder installed together in the same Eclipse environment, which you should, many features of the IDE can carry over including things like RDS dataview, RDS fileview, snippets and more. However, when it comes to things like extensions, there are some limitations based on my experience. Still, there's enough added value that even you straight Flash/Flex developers who got a copy of ColdFusion Builder with Flash Builder Premium may want to install it. Here's what I've found.

Adding Snippets and RDS Eclipse Views
Most of the functionality that carries over is via the various views ColdFusion Builder makes available within Eclipse. Most of these, like RDS DataView, RDS FileView and snippets are added to your perspective by default in ColdFusion Builder, but you will need to manually add them to your Flash Builder perspective. To do so, switch to the Flash Builder perspective and choose the Window > Show View > Other menu option. This will open the "Show View" dialog where, if you look under the ColdFusion folder, you'll find all the ColdFusion Builder views. Simply choose the item you want added to your Flash Builder perspective.

Using ColdFusion Builder Extensions
ColdFusion Builder extensions will work identically in Flash Builder within the views you have added. In RDS DataView, for instance, you could use something like the "Generate AS Class from DB Table" extension to quickly write out ActionScript value objects within your Flash/Flex application. Of course, you could even build your own extensions that might generate MXML scaffolds or anything else that might be useful in Flash Builder - and it could be written in CFML.

While simply having extensions that work on RDS DataView in your Flash Builder install is enormously useful, other aspects of extensions appear to have limited functionality when used in Flash Builder. For instance, you will not see the custom menu items from any extensions when right clicking on the file view. This means that certain extensions that only work on the file view won't work in Flash Builder and others that have features dependent on this view will be limited.

You will see right click menu items from extensions within an open file if that file is handled by the Adobe CFML Editor. This means that by default if you open a CFM or CFC file within Flash Builder, your extension menu items will appear correctly within the open file. However, when opening an MXML or AS file they will not show up by default. You can work around this to a degree by going into your Preferences > General > Editors > File Associations settings and add the Adobe CFML Editor as an associated editor for MXML and AS files. While this won't make the extension features work, it now gives you the option to right click on a file in file view and choose Open With > Adobe CFML Editor. Even if the file is MXML or AS it will show your extension menu items within the file - for example when using Dan Vega's pastebin extension. You will not, however, see the proper code highlighting or get your typical code hinting that you would when editing the file with the ActionScript editor or MXML editor. You will also need to re-choose the proper editor the next time you want to open the file as Eclipse remembers your preference from the prior opening. Nonetheless, if you need access to a certain feature from an extension this could be a useful workaround.

Using Snippets in Flash Builder
The great news for you snippet addicts is that if you add the ColdFusion Builder snippet view to your Flash Builder perspective, snippets will work identically. This means not only that you can add, edit and insert snippets via the view itself, but even using the trigger text plus Command+J will work regardless of whether the file is a CFM/CFC or MXML/AS. Plus, since a snippet doesn't care what kind of content its inserting you can write snippets to insert any MXML or ActionScript you find useful in Flash Builder. Of course, any replace variables and other features work the same. I'll admit to being a rare snippet user, but Matt Gifford has a great tutorial on ColdFusion Builder snippets if the ability to use them in Flash Builder is enough to convince you to start using them.

Comments

Dan Vega I started a Google group for extension development. If anyone has questions or wants to share an idea / extension please stop by and sign up.

http://groups.google.com/group/cfb-extensions-dev

Posted By Dan Vega / Posted on 05/16/2010 at 10:01 AM


Simon Hi,

For Flex/Flash developer, is it possible NOT to install CFBuilder Eclipse IDE, but only to use it as a Flash Builder Plugin?

Thanks

Posted By Simon / Posted on 05/29/2010 at 10:46 PM


Brian Rinaldi Both CFBuilder and Flash Builder are separate installs. If you install Flash Builder standalone, you can install CFBuilder plugin into it (and vice versa) or install both into an existing Eclipse install.

Posted By Brian Rinaldi / Posted on 05/30/2010 at 5:52 AM


Write your comment



(it will not be displayed)





About

My name is Brian Rinaldi and I am the Web Community Manager for Flash Platform at Adobe. I am a regular blogger, speaker and author. I also founded RIA Unleashed conference in Boston. The views expressed on this site are my own & not those of my employer.