Hi Lidia,
Sorry you have stumped me on that one. But I have a few guesses that may help you debug the issue:
1- Stick a breakpoint on org.eclipse.ui.internal.WorkbenchPage.openEditor(IEditorInput, String, boolean, int, IMemento, boolean) - that should help you track down in the stack trace where the decision was made.
2- The plug-in that contributes an item to the view normally has control over what happens when you double-click or open the file. However the Open With command is handled generically. That means a plug-in can force a specific editor on normal opens, but users can override by using Open with.
3- For a CDT contributed element, org.eclipse.cdt.internal.ui.util.EditorUtility.getEditorID(IEditorInput, Object) is in charge of figuring out which editor to use
4- org.eclipse.ui.ide.IDE.EDITOR_KEY is the persistent property (see org.eclipse.core.resources.IResource.getPersistentProperty(QualifiedName)) that keep track of overrides for a single file. I don't know where the global overrides are stored.
I hope that helps you figure out the problem. It would be great if you could report back what the issue ended up being.
Thanks
Jonah