예제 #1
0
 private void parseRequires(Node node) {
   NodeList children = node.getChildNodes();
   for (int i = 0; i < children.getLength(); i++) {
     Node child = children.item(i);
     if (child.getNodeType() == Node.ELEMENT_NODE) {
       if (child.getNodeName().equalsIgnoreCase("import")) { // $NON-NLS-1$
         IFeatureImport iimport = getModel().getFactory().createImport();
         ((FeatureImport) iimport).parse(child);
         ((FeatureImport) iimport).setInTheModel(true);
         fImports.add(iimport);
       }
     }
   }
 }
예제 #2
0
 private void addNewDependency(
     String id, String version, int match, List preservedImports, List newImports)
     throws CoreException {
   if (findFeaturePlugin(id, version, match) != null) {
     // don't add imports to local plug-ins
     return;
   }
   if (findImport(preservedImports, id, version, match) != null) {
     // already seen
     return;
   }
   if (findImport(newImports, id, version, match) != null) {
     // already seen
     return;
   }
   IFeatureImport iimport = findImport(fImports, id, version, match);
   if (iimport != null) {
     // import still valid
     preservedImports.add(iimport);
     return;
   }
   // a new one is needed
   iimport = getModel().getFactory().createImport();
   iimport.setId(id);
   iimport.setVersion(version);
   iimport.setMatch(match);
   ((FeatureImport) iimport).setInTheModel(true);
   newImports.add(iimport);
 }