@Override
 public ModuleDelegate getModuleDelegate(IModule module) {
   for (ModuleDelegate moduleDelegate : moduleDelegates) {
     if (moduleDelegate.getModule() == module) {
       return moduleDelegate;
     }
   }
   return null;
 }
Exemple #2
0
 /**
  * searches the Manifest.mf file in the module
  *
  * @param module
  * @return
  */
 public static File findManifest(IModule module) throws CoreException {
   ModuleDelegate md = (ModuleDelegate) module.loadAdapter(ModuleDelegate.class, null);
   IModuleResource[] res = md.members();
   for (int i = 0; i < res.length; i++) {
     if ("META-INF".equals(res[i].getName())) {
       IModuleResource meta = res[i];
       if (meta instanceof IModuleFolder) {
         IModuleResource[] metaContents = ((IModuleFolder) meta).members();
         for (int j = 0; j < metaContents.length; j++) {
           if ("manifest.mf".equalsIgnoreCase(metaContents[j].getName())) {
             IModuleResource mf = metaContents[j];
             return mf.getAdapter(File.class);
           }
         }
       }
     }
   }
   return null;
 }