angelozerr/eclipse-wtp-xml-search — pull request #40 by gamerson (2014-11-11 08:06:16+00:00)
Title: Directly use platform content type API for finding content type

fixed #38

So the previous used model handler API which didn't work for adopters since not all contentTypes have their own model handlers. So we researched the IStructuredModel loader, how it gets its contentType, and it turns out all of the smarts can be found here: ```org.eclipse.wst.sse.core.internal.FileBufferModelManager.detectContentType(IFileBuffer)```

If you look in that class you can see if has 8 or 9 different contentType lookup methods and failovers. However, when the content is an IFile, like it is with XML search's scenario, there are only 2 ways to find contentType for the file, lookup directly and one platform fallback.

So I've replicated that logic here in this new pull and no longer call into the ModelManager to get the content Type.

This doesn't break Liferay use-cases, but I hope it doesn't break any of your own extensions either, only testing will tell.