Paul Robertson's words, punctuated

Thoughts on development, user-centered design, code, etc. by Paul Robertson

FlashBuilder Burrito templates for Robotlegs and more

Update: thanks to Ondina’s suggestion, I’ve posted all these templates (individually and in groups) to a GitHub repository. Feel free to take them, change them, add your favorites, etc.

I’m really excited about the Flash Builder “Burrito” release that was added to Adobe Labs today. Even ignoring the new mobile publishing and Hero SDK features, I think the developer productivity features that have been added to Burrito make it the best Flash Builder (or Flex Builder) release since, well, ever.

One of my favorite features is the new templates (snippets) that you can use. To add a template, just start typing the name of the template and hit Ctrl/Cmd+Space. (If you see too many hints, hit Ctrl+Space again to just get template code hints.) Your cursor will automatically be placed in the first template field. Once you type that field, you can hit TAB to jump to the next template field.

However, the only way you can get benefit out of the templates is if you have templates to use! If you’ve used FDT, you may already have a bunch that you use. I found that for the most part FDT templates can be used in Flash Builder “Burrito” but there are a few minor differences in syntax for some of the template variables.

Anyway, to save you some trouble and give you a chance to try out templates in Flash Builder “Burrito,” I thought I’d share the templates that I use the most. To load them up, just open up preferences, then choose Flash Builder > Editors > Code Templates > ActionScript. Click the “import” button below the list of templates, and choose the XML file to import. Here are the templates I use the most, modified to work with Burrito:

  • Robotlegs templates - There are quite a few here, including “command body,” “map command,” “map context listener,” “map listener,” “map view listener,” “mediator body,” “post construct,” “unmap command,” and “unmap listener”
  • “Property” template (a complete “property” including getter, setter, and “backer” variable)
  • AS3-Signals template (I only use this one so far, which is for creating a Signal property on a class)
  • General ActionScript templates - by default the templates that come with Burrito have the opening curly brace on the same line rather than the next line. Naturally I had to fix that! This set of templates modifies the built in ones (plus I think it has a couple more that I added, but I can’t remember for sure).
  • All templates - If you really just want to trust me completely, here’s an export of all my templates in my current set in Burrito

Hopefully these are helpful for you to use and adapt. If you have any questions about them or your own templates to recommend, feel free to share them.