Thursday, June 07, 2007

MXML Autocomplete In Eclipse

I got autocompletion working while editing mxml file in eclipse, here are the few simple steps to follow:

1. First look if you have mxml2.xsd file in the flex installation directory. If you don't have
then get it here.

[NOTE: If you don't have webtools for eclipse, you will have to install it, follow the method suggested in Step 1 in the link
for your eclipse version.]

2. Window -> Preferences -> Web And XML -> XML Catalog
Add User Specified Entries
URI:
Key Type: Namespace Name (Its autofilled)
Key : http://www.adobe.com/2006/mxml (Its autofilled)

3. Window -> Preferences -> General -> Editors -> File Association
Add File Types: *.mxml (Click on Add next to listed file preferences and add it)
Associate Editor: XML Editor (Click on Add under Associate editors and select it)

4. Window -> Preferences -> General -> Content Types
Under Text Edit -> XML, Add *.mxml

You should get drop down list if you do: <mx: type CTRL+SPACE within
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
</mx:Application>

References:
http://www.straker.co.nz/shadozoom/blog/2005/editing-mxml-files-with-eclipse-3.1.cfm
http://cfsilence.com/blog/client/index.cfm/2007/3/26/Setting-Up-Eclipse-For-Flex-2

Comments:
You can install the Web Tools Platform a bit easier using the update url from inside Eclipse:

http://download.eclipse.org/webtools/updates/

Ignore the J2EE stuff, and you'll have eerything you need.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?