if (selection instanceof IStructuredSelection) {
IStructuredSelection sel = (IStructuredSelection) selection;
Object el = sel.getFirstElement();
if (el instanceof EClass) {
EClass eclass = (EClass) el;
String platformString = eclass.eResource().getURI().toPlatformString(true);
Path path = new Path(platformString);
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
if (file == null) {
return;
}