Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Forcing StructuredTextEditor to recognize XML
Forcing StructuredTextEditor to recognize XML [message #905568] Thu, 30 August 2012 16:43 Go to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1076
Registered: July 2009
Senior Member
I have a multi-page editor that uses StructuredTextEditor to show an XML source view of a file. A user can create a empty file with any file extension, then invoke open-with (select my editor). At which point I get unrecognized content type in editor popup and StructuredTextEditor is confused.

In my multi-page editor scenario, I know that the file is supposed to be XML, regardless of whether Eclipse has a content type registered that makes it recognize that file as XML. Is there a way to force StructuredTextEditor into XML mode?


- Konstantin
Re: Forcing StructuredTextEditor to recognize XML [message #906138 is a reply to message #905568] Fri, 31 August 2012 17:25 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3011
Registered: July 2009
Senior Member

Associating the same classes used with the org.eclipse.wst.sse.ui.editorConfiguration extension point in org.eclipse.wst.xml.ui ( will make sure the editor page behaves as desired for a IStructuredModel containing XML, though without the file being reported as the XML content type (or our "broken" XML content type), the model can not be built.

The expectation when dealing with IFiles is that the (now deprecated) org.eclipse.core.filebuffers.documentCreation extension point will allow us to provide our structured document instance when the file is read into a file buffer, something that only happens if the file's content type matches. Everything starts there, even our headless support.

Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:How to make Content assist working when editors are inside Composite?
Next Topic:JSF 2.2.m05 Taglib support
Goto Forum:

Current Time: Tue Nov 21 07:59:17 GMT 2017

Powered by FUDForum. Page generated in 0.03122 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software