FlashBuilder Burrito Code Templates [Inject]

Ondina D.F.'s Avatar

Ondina D.F.

Nov 04, 2010 @ 07:12 PM

FlashBuilder Burrito Code Templates [Inject]

Window > Preferences > FlashBuilder > Editors > Code Templates > ActionScript

Add: New Template
Name: xx (a name of your choice)

Pattern:
[Inject] public var ${someVar}:${someType};
Save it.

In your code:
Content Assist (Ctrl + Space)
type xx ( the name that you’ve chosen)

And voilà! Your Inject metadata tag will be good to go!

There is also a Metadata code completion feature but it doesn’t show the RL Inject tag.

“Flash Builder also supports metadata tags from third party SWCs if they have the required metadata.xml file embedded in them.” (source http://www.adobe.com/devnet/flex/articles/coding_enhancements_burri...)

Ondina

  1. Support Staff 1 Posted by Shaun Smith on Nov 05, 2010 @ 02:59 PM

    Shaun Smith's Avatar

    Hi Ondina,

    I've only just installed Burrito, so need some time to check it out properly. The article you linked to makes no mention of how to build that metadata.xml file. Any idea?

  2. Support Staff 2 Posted by Ondina D.F. on Nov 05, 2010 @ 04:23 PM

    Ondina D.F.'s Avatar

    Hi Shaun,

    if you look under

    \Adobe Flash Builder Burrito\sdks\4.5.0\frameworks

    you’ll see a metadata.xml file, that contains the supported metadata tags.
    I guess the custom metadata.xml file should follow that structure, but I have no idea about the right syntax for an Inject tag with a template for a variable

    Maybe something like this?

    see attachment

    (I don’t know how to edit xml in here, the code or pre tags don't work with xml? )

    This way you’d probably get just the [Inject] tag without the
    public var ${someValue}:${someType};

    I could ask (over the weekend or next week) on the Flex Forum how to do that...

    Ondina

  3. 3 Posted by Paul Robertson on Nov 08, 2010 @ 10:44 PM

    Paul Robertson's Avatar

    This turned out to be pretty straightforward to add. Ondina's text file was pretty much spot-on. I've got this working in my fork of Robotlegs if you're interested:

    https://github.com/probertson/robotlegs-framework/commit/08c8d55b5d...

    One issue I ran into was that once I added the SWC to a project, I had to restart Flash Builder in order for the code hints to show up. I'm not sure if that's just an issue with my machine or a general bug, but in any case I filed a bug about it.

    The documentation for adding the code hints is here (although it only tells how to package them, not the syntax for the xml file):

    http://goo.gl/9h5Zx

  4. Support Staff 4 Posted by Shaun Smith on Nov 08, 2010 @ 11:46 PM

    Shaun Smith's Avatar

    Awesome! Thanks Ondina and Paul. I've merged those changes in, and they'll go out in the next release.

  5. 5 Posted by Nikos on Nov 09, 2010 @ 10:43 AM

    Nikos 's Avatar

    im installing it now, any luck migrating fb4 projects?

  6. Support Staff 6 Posted by Ondina D.F. on Nov 09, 2010 @ 11:05 AM

    Ondina D.F.'s Avatar

    That’s great! Thanks, Paul and Shaun.

    For those interested in FlashBuilder Burrito templates see Paul’s
    http://probertson.com/articles/2010/10/25/flashbuilder-burrito-temp...

    Paul, could you put the templates on github, so everyone can contribute with new patterns?

    Cheers,
    Ondina

  7. Support Staff 7 Posted by Ondina D.F. on Nov 09, 2010 @ 11:06 AM

    Ondina D.F.'s Avatar

    Hi Nikos,

    I’ve migrated one of my projects from FB4 to Burrito successfully. No issues yet.
    Ondina

  8. 8 Posted by Nikos on Nov 09, 2010 @ 11:21 AM

    Nikos 's Avatar

    Cool, I take it you can't share workspaces?

  9. Support Staff 9 Posted by Ondina D.F. on Nov 09, 2010 @ 11:32 AM

    Ondina D.F.'s Avatar

    Obviously not possible:
    Please note that using an existing Flash Builder 4 workspace with Flash Builder "Burrito" is not supported - you should use the default workspace created for you or define new workspaces using Flash Builder "Burrito". (http://labs.adobe.com/wiki/index.php/Flash_Builder_Burrito)

  10. 10 Posted by Nikos on Nov 09, 2010 @ 11:35 AM

    Nikos 's Avatar

    yeah thought so thanks Ondina Robot :)

  11. 11 Posted by Paul Robertson on Nov 09, 2010 @ 04:40 PM

    Paul Robertson's Avatar

    At Ondina's suggestion, I've posted my templates on GitHub:

    https://github.com/probertson/FlashBuilder-templates

    It's just the XML files for now. I'll try to add Readme files soon with more explanations.

  12. 12 Posted by jadd on Nov 09, 2010 @ 05:59 PM

    jadd's Avatar

    Hi guys,
    great usefull post for the RL comunity! How about a little step-by-step tutorial for us "mortals" Paul?
    Thanks a lot, long live to RL!

  13. 13 Posted by Paul Robertson on Nov 09, 2010 @ 06:41 PM

    Paul Robertson's Avatar

    To import the templates into Flash Builder Burrito:

    1. open up preferences
    2. choose Flash Builder > Editors > Code Templates > ActionScript.
    3. Click the “import” button below the list of templates
    4. choose the XML file to import

    Once you have the template imported, to use a template:

    1. Start typing the name of the template (e.g. "inj" for the "inject" template)
    2. Hit Ctrl+space to trigger code hints. By default template hints are mixed in with other hints, so you may need to type a few more characters to get your template. Or you can hit Ctrl+space again to just get template proposals and nothing else
    3. With the desired template selected, hit [enter]
    4. The cursor will now be in the first template field (e.g. the variable name for the Inject template). Type the value you want.
    5. Hit [tab] to jump to the next field and enter its value. If you're entering a class name, you can hit Ctrl+space for code hints and when you select the class name with [enter] it should add the import statement etc.
    6. When you're done with the last template field, hit [tab] once more to jump to the end of the template so you can continue coding.
  14. 14 Posted by Nikos on Nov 16, 2010 @ 01:58 PM

    Nikos 's Avatar

    Sadly my burrito doesn't install, I'll have to wait

  15. Stray closed this discussion on Feb 18, 2011 @ 07:12 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac