- This topic has 14 replies, 7 voices, and was last updated 19 years, 2 months ago by Riyad Kalla.
-
AuthorPosts
-
P.G.TaboadaMemberHi,
using M2 on a fresh 3.1 -> I cannot edit my build.xml files with the ant editor anymore. In the preferences page, I noticed the “(locked)” label after the ant-editor – whats happening?
Disabling myeclipseide makes it work again.
brgds,
Papick
Riyad KallaMemberPapick,
Right click on your build.xml file, the “Archive” flag should be the only one checked.Also, is this file under source control? If so, make sure it is checked out.
P.G.TaboadaMemberOpen with ANT-Editor is not offered when I right click. Archive is the only one. Clean install, no source control, local disk.
strange, isn’t it?
ErezMemberHi, I want to report the same ‘locked’ issue with Ant. If I create a simple XML file HelloWorld.xml I don’t get the ‘Ant Editor’ on the right click menu as stated in the Help. I am too using the MyEclipse 4.0M2/Eclipse 3.1.
No source control.Erez
ErezMemberI don’t know what or why? But I managed to get the xml file open with the Ant Editor.
I set the ‘Ant Editor’ as the default file association for .xml files. The default was ‘MyEclipse Web Browser’.
Still, why does it mean ‘(locked by ‘Ant Buildfile’ content type) ?Thanks,
Erez
Scott AndersonParticipantErez,
You don’t need to change the defaults. All you have to do is add the name of your file to the Ant Editor content type at Window > Prefereces > General > Content Types > Text > XML > Ant Buildfile > Add…
The reason some of them show as locked is that they are contributed by plugins, in this case the Ant build file editor, so they can’t be changed by the user.
ErezMemberScott,
The reason some of them show as locked is that they are contributed by plugins, in this case the Ant build file editor, so they can’t be changed by the user.
What cannot be changed by user?
I replaced back the MyEclipse XML Editor as the default XML editor in file association. Then, I opened the list of text>xml>ant buildfile>.. as you suggested. The list shows the strange “(locked)” which I can’t figure out.
I wanted to add something like “*-ant.xml” or ant-*.xml” but it was not allowed to position the wildcard like that. So I added ‘*.ant.xml”. I tried to add a ‘a.ant.xml’, double clicked it and the MyEclipse XML Editor opened it instead of the Ant editor.One other thing I saw is that once we played with the Ant Buildfile editor as the default and then switched back to the MyEclipse XML editor as the default the ‘Ant Buildfile’ editor is now on the right-click menu list of editors. I mention this because before I touched the list of file-association editors the Ant Editor was not on the right-menu list.
Erez
lyloMemberHas anyone resolved this. I am using 3.1 and M3 and I can’t open up any XML file other than build.xml in the Ant editor. It’s driving me mad!
Please can someone post the definitive solution?
Riyad KallaMemberlylo,
Which issue are you running into? Are you right clicking on your XML files and not seeing “Ant Editor” as an option or are you having another issue?If it is the first issue, you can navigate to Window > Preferences > General > Content Types > Text > XML > Ant Buildfile, and here you can add new file mappings to be opened with the Ant Editor. I would like to add that the Ant Editor is not a good alternative to the MYEclipse XML Editor as it is specifically tuned for Ant build files and not necessarily XML files in the more general sense, but I suppose if you preferred it, it should work.
lyloMemberBy default, you can’t right-click on any XML file and open it in the Ant Editor. This is a flaw, since I have many Ant build files which are not called build.xml and it’s not possible to open these in the Ant editor – a huge drawback.
I have solved the problem by going to the File Associations dialog, selecting “*.xml”, adding the Ant Editor and then make this the default. Next, I go to the same dialog and make the My Eclipse XML Editor the default. Once I do this, I can right-click on any XML file in my project and open it in the Ant Editor should I wish to.
My Eclipse XML editor should of course be the defaut but I think you should allow any XML file to be openable in the Ant Editor.
Riyad KallaMemberlylo,
I think there is a misunderstanding here, MyEclipse does not provide the Ant Editor, the Ant Editor as well as the default mappings to it are all provided by the base Eclipse JDT. As I mentioned the Ant Editor is *not* an XML editor, and in some cases can cause errors when editing complex (valid) XML documents. That is why the Eclipse group does not ship a default rule to allow opening all XML files with it. If you wish to do this, you are free to create the mappings (as you have done).
sabushadiMemberthanks for reading … i’m offering a quick solution to what seems to be a common list of probems on this topic.
i’m also really new at this — like my first time today using MyEclipse and Eclipse and Ant and Spring and stuff — so bear with me if i get it wrong, but after reading these posts it seems there are a couple of issues.
i. MyEclipse comes with it’s own XML editor
ii. Ant has some kindof fancy XML editor that comes with it’s plugin too
iii. MyEclipse folks say their editor is better
iv. Ant users say they just want their editor back — for all xml files — as the default or as one of the options in the “right click on any *.xml files” listI think this has something to do with the order of editor priorities in the right click file association list. you can change that order and solve these common issues like this:
1. Window > Preferences > General > Editors > File Associations
2. find and select “*.xml” in the top half-screen list
3. find and select “Ant Editor …” — mine also says … (locked by ‘Ant Buildfile’ content type)
— note that it was pretty far down in the list and i think this is the problem: the fact that it’s lower than the MyEclipse XML editor makes it less important when considering which thingamajig takes responsibility for rendering the xml file in question
4. clicked the Default button to the right.the result was simple, now my build.xml file opens with the Ant XML editor instead of the MyEclipse editor. also, the “right click *.xml” > open with … menu now lists the Ant Editor at the top.
i figure this should allow anyone to right click on any *.xml file and open it. not sure about different file naming patterns like *.a.xml or whatever but i’d guess that you could just add that pattern to the same place where the other file patterns are in step 2 above.
hope that helps!
quick note to the MyEclipse folks … the solution to this kind of a problem would have been more intuitive to me if the “right click on any file” > Open With … list included another submenu that automagically read from all the available editors for that file type, so i could just go in there any pick any one of them. Maybe if i pick it more than once or something then MyEclipse (or Eclipse or whatever) could ask me if i wanted this as default or something. Ah, i guess this is more of an Eclipse suggestion since MyEclipse just sits on top of that, right? So, just ignore this part. Nice job so far though — looks real slick!
my setup looks like this :
[ linux | win32 ] + j2sdk1.4.2_09
Eclipse Version: 3.1.0
MyEclipse Version: 3.9.310
Riyad KallaMemberLet me correct a few things:
iii. MyEclipse folks say their editor is better
Our Editor is a general purpose XML editor, the Eclispe Ant editor is just that, it’s an Ant-specific editor. The autocomplete, syntax and other features of the editor are specific to Ant, not XML in general. Our editor is *better* for XML files other than Ant files.
Other than that your post is right on the money, good help to users and we appreciate you posting this for them with many details.
petergphillipsMemberWhat seems to be going on here is a Eclipse bug – not a bug or feature of MyEclipse at all.
Even on a clean Eclipse install (without MyEclipse installed) the ant editor does not open *.xml files (even though the ‘Content Types – XML – Ant Buildfile’ section states that *.xml is associated).
To fix the associations:
1. Set the Ant Editor to be the default editor (File Associations – set Ant Editor to be default for *.xml). Click OK.
2. Go back into File Associations and set the default for *.xml back to its previous value (in my case MyEclipse XML Editor). Click OK.
Now any *.xml file can be opened with the Ant Editor (right click on file and select Open With – Ant Editor).
Eclipse Version: 3.1.0
Riyad KallaMemberPeter, thank you for following up as well for information that users trying this will likely need.
-
AuthorPosts