I wrote a extension to handle files with different endings ".xyz"
You have to define an editor which can open this file and you have to define a builder which can build this file.
The editor implementation for files which includes java source code can be, that you extend from the eclipse java editor and implement the extension point "org.eclipse.ui.editors".Add the file extension to the editor extension preference entry "extensions".
When you than open the specific file, the editor is used you have added.
I dont now if you can add a additional extension to an editor which is defined in an eclipse plugin. I think you have to do it by your own.
When you want to build the specific file as it usual is in eclipse, you have to implement a new builder, using "org.eclipse.core.resource.builders".
I do not have an example but the key word is "nature" (org.eclipse.core.resources.natures).
As far as i now you can add this builders to project you defined. I am not sure if you can add these builders to existing projects like a "Java plugin project".
When you just want to add a editor to a file extension you can do this in the preference page
"General" - "Editors" - "File Associations"