Exemplo n.º 1
0
 public void addRootPackages() {
   CompleteModelInternal completeModel = environmentFactory.getCompleteModel();
   String name2 = name;
   if (name2 != null) {
     CompletePackage rootCompletePackage = completeModel.getOwnedCompletePackage(name2);
     if (rootCompletePackage != null) {
       addNamedElement(rootCompletePackage);
     }
     CompletePackage completePackage = completeModel.getCompletePackageByURI(name2);
     if (completePackage != null) {
       addElement(name2, completePackage);
     }
   } else {
     for (CompletePackage rootCompletePackage : completeModel.getOwnedCompletePackages()) {
       if (rootCompletePackage != null) {
         addNamedElement(rootCompletePackage);
       }
     }
     for (CompletePackage completePackage : completeModel.getAllCompletePackagesWithUris()) {
       String nsURI = completePackage.getURI();
       if (nsURI != null) {
         addElement(nsURI, completePackage);
       }
     }
   }
 }
Exemplo n.º 2
0
 @Override
 public int compare(
     @NonNull EnvironmentFactoryInternal environmentFactory,
     org.eclipse.ocl.pivot.@NonNull Package match1,
     org.eclipse.ocl.pivot.@NonNull Package match2) {
   CompleteModelInternal completeModel = environmentFactory.getCompleteModel();
   CompletePackageInternal completePackage1 = completeModel.getCompletePackage(match1);
   CompletePackageInternal completePackage2 = completeModel.getCompletePackage(match2);
   if (completePackage1 == completePackage2) {
     return 1; // match2 inferior
   }
   return 0;
 }