}
return true;
}
protected String getContentType(IDocument document) {
IModelManager mgr = StructuredModelManager.getModelManager();
String contentType = null;
IDocumentProvider provider = fTextEditor.getDocumentProvider();
if (provider instanceof IDocumentProviderExtension4) {
try {
IContentType type = ((IDocumentProviderExtension4) provider).getContentType(fTextEditor.getEditorInput());
if (type != null)
contentType = type.getId();
}
catch (CoreException e) {
/*
* A failure accessing the underlying store really isn't
* interesting, although it can be a problem for
* IStorageEditorInputs.
*/
}
}
if (contentType == null) {
IStructuredModel model = null;
try {
model = mgr.getExistingModelForRead(document);
if (model != null) {
contentType = model.getContentTypeIdentifier();
}
}
finally {