protected final ITagRegistry findTagRegistry(final IFile file)
{
final IContentTypeManager typeManager = Platform.getContentTypeManager();
final IContentType contentType =
typeManager.findContentTypeFor(file.getName());
ITagRegistry tagRegistry = null;
if (contentType != null)
{
final TagRegistryIdentifier id =
new TagRegistryIdentifier(file.getProject(), contentType);
tagRegistry = CompositeTagRegistryFactory.getInstance().getRegistry(id);