June 8th, 2007
The quest for the holy mxml/as3 snippets
Over the last several months I have been on a quest…I REALLY like developing my projects in Flex Builder, but there has been one bummer about it all along, code snippets.
During my quest I’ve tried out alternate IDEs:
But to my dismay there was always something about them that to me seemed pale in comparison to the features and functionality of Flex Builder for Flex/Apollo development.
So…the search continued…
The next thing I though about doing was leveraging the CFEclipse plugin’s Snip Tree View with AS3/MXML. This proved to be very promising…works pretty well with .as files in the Flex Development perspective:
However, the Cfeclipse Snip Tree View did not work at all with MXML files… basically, the mxml editor disables the insertion of the snippet after populating necessary variables.
So after tedious toil I gave up for a couple weeks…time passes…
Today I was working on an app and was getting sick of typing in the same code over and over again. I decided that although snippet tools with support for dynamic variables was not something I had succeeded in finding, I figured I could just find a little code clipboard plugin to paste in some of the more common code structures. (Then I could use Replace/Find to populate the dynamic pieces.)
I found a promising clipboard app called Multi Clipboard by an author who has a pretty bad-ass Regular Expression plugin called QuickREx , so I installed Multi Clipboard. After the plugin installation, I restarted my workbench and went to Window menu –> Other Views to add the Multi Clipboard to my Flex Development perspective.
For some reason I though that the Multi Clipboard would be listed under General views, which it wasn’t, but luckily for me I stumbled upon something interesting called Snippets:
Once the Snippets view was in view, I quickly realized that I had stumbled upon the holy grail of mxml/as3 snippet creation in Flex Builder…are you skeptical? Check out these screenshots:
Below is the crowning feature, dynamic snippet with MXML files, woo-hoo!!
So…if you’ve read this far, I’m sure you’re liking what you see…here’s the deal, to get this functionality, download the Eclipse Web Standard Tools (WST) Project. Mine’s version 1.5.4…
Now I just need to find a Shrubbery…
-Jun















August 9th, 2007 at 8:09 am
[...] following Jun’s comment and blog post about snippets today I decided to take the plunge, expecting it to be a fairly quick job. I kept [...]
August 10th, 2007 at 11:06 am
[...] in June I had blogged about how cool WST was for creating dynamic MXML and AS Snippets. Recently my blog post had caused some pain and torment to a fellow Flex developer due to Eclipse [...]
October 28th, 2007 at 3:24 am
I’m desperately trying to put my hand on a snippet tutorial but haven’t found anything yet.
Any chance chance you post a tutorial or a link you might know?
Thanks.
—————————————————-
PeZ,
Sorry to take so long to respond…been pretty swamped lately with a big project so my blog has been pretty tumbleweed lately.
As far as existing tutorials…none that I know of.
Anyway, I can’t guarantee anything, but I will put this suggestion into my pool of blog ideas. Right now I got a good backlog, but since I do like using WST Snippets, this would be a good candidate.
-Jun
January 15th, 2008 at 6:21 am
Jun, nice post, I was playing with the idea of using the snippets panel at the end of last year. I use a macro app on the Mac called TextExpander to perform similar operations.
Thanks for the heads up I’ve got something to play with over the coming weekend now
================================
Thanks, yeah, I love the Snippets panel, especially for comments or Cairngorm stuff. I hope it works for you.
Also, I’ve had comments from users in the past that my post was incomplete, so if you find yourself with any questions about getting up and running with it feel free to hit me up.
-Jun
May 2nd, 2008 at 11:57 pm
[...] this time last year I read an excellent blog post from fellow developer Jun, regarding snippets in Eclipse (read:FlexBuilder), but I had some issues [...]
May 7th, 2008 at 3:02 pm
Thanks, you just made this developer VERY happy…and much more productive! You’re my hero!
——————————————————————————————–
Awesome, glad to help!
-Jun
October 29th, 2008 at 8:25 am
Hi,
This is really cool, but I’d like to get access to the Eclipse variables so we can easily insert stuff like today’s date, file name, project name, etc. I’ve been looking for hours, but I can’t find anything. It seems to me this must be possible, but… any ideas?
t
October 30th, 2008 at 11:56 am
Hi Tim,
Thanks for the kind words.
Unfortunately I have not seen any eclipse snippet tools out there that have access to Eclipse variables. If you do find one, please share.