{
    if (IFile.class.isInstance(structuredSelection.getFirstElement()))
    {
      IFile file = (IFile)structuredSelection.getFirstElement();

      if (FILE_EXTENSIONS.contains(file.getFullPath().getFileExtension()))
      {
        return 
          (EPackage)EcoreUtil.getObjectByType
            (new ResourceSetImpl().getResource(URI.createPlatformResourceURI(file.getFullPath().toString(), true), true).getContents(),
             EcorePackage.Literals.EPACKAGE);
      }
    }

    return null;
  }