- This topic has 5 replies, 3 voices, and was last updated 14 years, 8 months ago by
Brian Fernandes.
-
AuthorPosts
-
barborisMemberI am having trouble with the file associations/content type locks by MyEclipse.
I am currently working on a Struts project in Eclipse, without the Project Capability set up. So whenever I try to open the XML for Struts config, it tries to open it in the Struts Config Editor and gives an error, so I need to Open With for every struts config file.
I would like to associate any .xml file to open with the MyEclipse XML Editor. How can I do this? I tried doing it in Eclipse Preferences, but all the XML associations are locked by MyEclipse.
Thank you in advance.
April 25, 2008 at 1:59 pm #284443
Brian FernandesModeratorbarboris,
After you use “Open with” for a given file and point to the XML editor instead of the Struts Config editor, the XML editor will become the default editor (for that file only) and will open when that file is double clicked at any later time. So using Open with should only be necessary once for each config file you need to work with. Is this not happening for you?
If this is not acceptable, go to Window > Preferences > General > Editors > File Associations and select *.xml from the list on the right. In the Associated editors pane, select the MyEclipse XML editor and click Default.
I would recommend sticking to the former solution as the latter would affect other XML editors besides the Struts config editor.
Hope this helps.
October 19, 2010 at 5:06 am #312074
Jack GouldMemberThis thread is a little old, but I thought I’d ask a follow-up question, regardless…
Is it possible to have the ‘Source’ tab be the default tab to open in the various MyEclipse XML editors and properties file editors? Most of the time, I don’t want to see a stylized view of the XML content. And, honestly, the cost of creating the graphical view of a Struts configuration isn’t usually worth it.
Thanks.
October 19, 2010 at 7:52 am #312082
Brian FernandesModeratorjiggould,
For most of our editors, the last tab left open when the editor was closed will be remembered for that editor, across the entire workspace. So if you stick to the source tab editor, it will reopen when you use that editor again on any file.
Could you please let me know which editor(s) you are having trouble with?
October 19, 2010 at 8:30 am #312084
Jack GouldMemberBrian,
Thanks for the quick reply. I have had the most trouble with the Struts2 config editor. I will often get NPE or other errors, and sometimes Eclipse becomes unresponsive for an unacceptable length of time. I hope this doesn’t matter, but I am running on OS X with java version “1.6.0_20”.
I am well aware that your editors remember their tabs. However, I have 700 XML files in my workspace, and I have three different versions of that workspace (for CVS branches, because of parallel development). So, I am not willing to preemptively open 2100 XML files for the convenience of having the ‘Source’ tab open when I actually want to edit the file.
So, really, a preference that sets the default tab to display for your editors would be very helpful.
October 19, 2010 at 8:46 am #312085
Brian FernandesModeratorjigould,
What version of MyEclipse are you using? The Struts 2 graphical configuration editor was significantly improved in 9.0M1; I realize 9.0M1 is not a stable MyEclipse release but am concerned if you are using it and still notice errors or NPEs.
I am well aware that your editors remember their tabs. However, I have 700 XML files in my workspace, and I have three different versions of that workspace (for CVS branches, because of parallel development). So, I am not willing to preemptively open 2100 XML files for the convenience of having the ‘Source’ tab open when I actually want to edit the file.
You misunderstood what I said in my previous post, the last tab is remembered per Editor, not per file. Open a.xml and leave the design tab open before you close it. Open b.xml (it will open on the Design page) and leave the source tab open before you close it. If you now open a.xml, it will open with the source tab as that was the last tab used for the editor. While this behavior does exist in 8.6 for our simple XML editor, it does not exist in 8.6 for the Struts 2 configuration editor; this too was fixed in 9.0M1.
If you wish to ignore the graphical editor in 8.6, you could right click the configuration file and choose “Open With > MyEclipse XML Editor”. Our Struts 2 outline, autocomplete and wizards will still be available, even in the simple XML editor. “Open with” does need to be done once per file, subsequently double clicking will open with the last used editor for that file.
I will file an enhancement request which should allow users to turn off the graphical editor entirely in the default Struts 2 Configuration editor.
Hope this helps and thank you for reporting this.
-
AuthorPosts