I’m trying to develop an Eclipse plugin that guesses some properties regarding the file that is currently edited.
E.g. I’d like to guess programming language (e.g. Java, C++, xml, etc.), JRE version supported (e.g. for Java projects), etc.
I found something using the following:
ResourcePlugin.GetWorkspace().getRoot().getFileExtension();
ResourcePlugin.GetWorkspace().getNatureDescriptors();
ResourcePlugin.GetWorkspace().getRoot().getPersistentProperties();
but these are not enough for me.
Any hint about this?
Check
IFile.getContentDescription().getContentType().getName()… It will give you the basis for how Eclipse choose the editor used to open the file…