BLOG
4 August, 2004
More on Flex, MXML, Eclipse & the oXygen Plug-in
As mentioned previously I've been trying out the oXygen plug-in for Eclipse to write MXML for Flex on OS X, in this post I thought I'd give some more detail on just what the plug-in is capable of doing.
The first thing is setting oXygen up so that you can author MXML. From the preferences in Eclipse choose the oXygen options and from there expand: Editor > Tag Insight. Here's where you point oXygen at the MXML schema.
The xsd file for the schema is included in your Flex installation directory at: Flex install/extras/schema/mxml.xsd. I've chosen to place a copy of the schema in a directory relevant to the Flex development work on my own machine.
Once you've configured oXygen you should be able to start doing your Flex development. One of the benefits of using something like oXygen is it's ability to offer tag insight based on the schema, you can see from the screen shot above that it's doing a case sensitive type ahead for all MXML tags commencing with "H". It's just as effective for tag attributes as well.
Since oXygen is interpreting tags another great feature is the Outline view that you see above. An outline of all the page's tags allows the developer to quickly locate a tag, while oXygen highlights the selected tag in the editor to the right.
I'm happy to delve into this topic further, please leave a comment here if you'd like to see more information.
Comments
What about the ActionScript code that can be imbedded? How does oXygen handle syntax checking and highlighting of the ActionScript code?
Comment made by Chris Velevitch / Posted at Thursday 05 August, 2004 02:08
Excellent question Chris, not as yet and I haven't heard of anyone working on an ActionScript plug-in for Eclipse - once that's there you'd have a pretty good authoring environment.
Comment made by Andrew Muller / Posted at Thursday 05 August, 2004 02:08
I've been using a JavaScript plugin that was referred to on the CFEclipse web site. However, if it wasn't clear, my question was about embedding ActionScript in MXML <mx:Script></mx:Script> tags. Of course, if best practice is to use <mx:Script source="all_my_miscellanous_code.as" /> tag, then it's not really important that XML editor plugins handle it, is it?
Comment made by Chris Velevitch / Posted at Thursday 05 August, 2004 03:08
I heard there is a German development company working on a AS 2 plugin for Eclipse. I got it from a quite good source there, but it doesn't seem to be clear if it will be open source or commercial.
Comment made by Kai / Posted at Friday 06 August, 2004 09:08
AS2 plugin is available for Eclipse..check this out...http://sourceforge.net/projects/aseclipseplugin/
Its the first version but I believe over the time it would be more better.
- Abdul
Comment made by Abdul / Posted at Wednesday 10 November, 2004 02:11
What did you do to associate MXML files with Oxygen? I see code hinting if I save a file as .xml, but not .mxml. Thanks!
Comment made by Hans Omli / Posted at Saturday 11 December, 2004 09:12
To make it work with .mxml, add a file association for *.mxml with the Oxygen XML editor. Window > Preferences > Workbench > File Associations.
Comment made by Jim / Posted at Thursday 23 December, 2004 01:12
I was using Oxygen 5 with Eclipse quite happily, but the Oxygen 6 update now seems determined not to let me do any tag insight except for a closing tag, the CData and a comment. Anyone else had this issue? Did you get around this?
Comment made by Nick / Posted at Thursday 30 June, 2005 01:06
If all you can see in the tag insight popup in Oxygen version 6 is a closing tag, CDATA and comment, then you did not declare a schema in your MXML document explicitly (using a DOCTYPE declaration or a schemaLocation attribute of the root element) or implicitly (by setting the schema to be used for a certain root element and namespace, that is by setting a rule in the table available at Options - Preferences - Editor / Tag Insight / Default). For more info please see:
http://www.oxygenxml.com/doc/ug-standalone-en/configuring-the-editor.html#tag-insight-default
HTH,
Sorin
Comment made by Sorin Ristache / Posted at Thursday 30 June, 2005 05:06
Also see
http://www.oxygenxml.com/doc/ug-eclipse-en/editing-xml-documents.html#associate-schema-to-document
Sorin
Comment made by Sorin Ristache / Posted at Thursday 30 June, 2005 05:06
If you want to combine elements from more than one namespace in the same XML document you should declare all the schemas for those namespaces in the schemaLocation attribute and associate prefixes to all the target namespaces of the schemas. If you do that the tag insight will offer you context sensitive tags from all the declared schemas.
Comment made by Sorin / Posted at Thursday 30 June, 2005 11:06
You know I followed your instructions for setting up oxygen for Flex dev and I still don't get tag completion.
I have to add an <Application> tag with an mx: xmlns attribute to get the tag completion working. Is this what I should expect?
thx...
erik
Comment made by Erik Weibust / Posted at Friday 01 July, 2005 01:07
Erik - that's exactly what is happening to me now in v6. Not a lot of help when I'm trying to develope Cairngorm apps across multiple namespaces.
Comment made by Nick / Posted at Friday 01 July, 2005 01:07
Hi Erik,
From what I understand if you have your document like:
<Application>
...
</Application>
the content completion does not work, but if you have it as:
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
...
</mx:Application>
then it works?
If that is the case then yes, that is the expected behavior as in the first case the Application element is from no namespace and that cannot be equivalent with the Application element from the http://www.macromedia.com/2003/mxml namespace.
If that is not the case then posting small samples or sending them to support at oxygenxml dot com will help us understand what happens.
Best Regards,
George
--
George Cristian Bina
http://www.oxygenxml.com
Comment made by George Bina / Posted at Friday 01 July, 2005 02:07
Hey George,
Thx for the help. I'm doing the following...
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"></mx:Application>
Then I try to add something (i.e. <mx:But) and then I try to tag-complete that and I get nothing.
I probably should take this up with oxygenxml support.
erik
Comment made by Erik Weibust / Posted at Friday 01 July, 2005 04:07
Hi Erik,
Did you set a rule for the namespace "http://www.macromedia.com/2003/mxml" in Preferences - oXygen - Editor - Tag Insight - Default ? That means adding a row to the table containing http://www.macromedia.com/2003/mxml in the namespace column and the URI of mxml.xsd in the Schema URI column. If you want to get tag insight when the root tag of the document is any tag from the namespace http://www.macromedia.com/2003/mxml then leave <ANY> in the Root local name column. If you want to get tag insight only for the Application tag then enter Application in the Root local name column.
I hope that helps,
Sorin
Comment made by Sorin / Posted at Friday 01 July, 2005 05:07
Hey Sorin,
Thx for the help. I've done exactly what you said. I took a couple of screenshots that show how I've configured Eclipse/Oxygen.
Erik Weibust
http://www.flickr.com/photos/erikweibust/22829224/
http://www.flickr.com/photos/erikweibust/22829259/
Comment made by Erik Weibust / Posted at Saturday 02 July, 2005 01:07
Dear Erik,
In Editor/Tag Insight/Default in the Root local name column you have to put just the local name, that is Application without the character < and the prefix. So replace <mx:Application with Application. You have to change the preferences in Editor/Tag Insight/XSL only if you want to see the tags from mxml.xsd on tag insight when you edit a XSLT stylesheet that generates an output containing tags from mxml.xsd, that is when the editor type is XSL. For getting tags from mxml.xsd on tag insight when editing a document of type XML you just have to set the correct rule in Editor/Tag Insight/Default.
Cheers,
Sorin
Comment made by Sorin / Posted at Saturday 02 July, 2005 01:07
Hey,
I have been using the mxml.xsd for oxygen for some time now, glas to see someone else doing it to. I have ran into a large issue though, maybe you haave found a workaround. If you noticed,remoteObject does not come up for tag insight, and messed things up when you go ahead and use it. I have talked with Spike, a active Flex/CfEclipse developer, and he did not have any pointers yet. Have you found a work around?
Comment made by Brian / Posted at Wednesday 17 August, 2005 04:08
Hi Brian,
Maybe the problem is that you used remoteObject and in the schema the element is RemoteObject? I tried a sample instance against mxml.xsd and added RemoteObject without noticing any problem.
Best Regards,
George
Comment made by George Bina / Posted at Thursday 18 August, 2005 12:08
You can get the same type of set up without using (and paying for) the oXygen plug in. If you use the Eclipse Web Tools platform, it comes with an XML editor that you can configure for content assist, use the outline view, etc.
More information here: http://www.darronschall.com/weblog/archives/000182.cfm
Comment made by darron / Posted at Monday 29 August, 2005 03:08
Post Your Comments