IEditorInput input= editor.getEditorInput();
if (input == null)
return null;
IDocumentProvider provider= editor.getDocumentProvider();
if (provider instanceof IDocumentProviderExtension4) {
IDocumentProviderExtension4 ext= (IDocumentProviderExtension4) provider;
try {
return ext.getContentType(input);
} catch (CoreException x) {
// ignore and return null;
}
}
return null;