With Nick Edgar's help, I was able to fix this problem. I think all the
new Eclipse plugin developers should make a note of this.
"When referring to another plugin's classes, never do this by directly
referencing its jars. Always add the plugin to your plugin's prerequisites
(in Manifest.mf), e.g. using Dependencies tab in the manifest editor."
When I saw the red line under some of the classes that I was trying to
use, I simply added the jars to the build path. This took care of the
compiler errors, but it gave me a whole new headache with the classloaders
(unknowingly ofcourse). Basically, in my case, FileEditorInput was being
loaded by two different classloaders and hence the problem. When I removed
the jars from the build path and added them as dependencies in the
Manifest file, the code worked like a charm. Thanks to all of you who gave
me helpful insights about this problem.