Esempio n. 1
0
  public static void resolveMPE(
      MindProject currentProject, EList<MindRootSrc> allsrc, MindPathEntry mpe) {

    MindObject resolvedBy = mpe.getResolvedBy();
    if (resolvedBy == null) return;
    switch (mpe.getEntryKind()) {
      case APPLI:
        break;
      case IMPORT_PACKAGE:
        MindPackage mpackage = (MindPackage) resolvedBy;
        addSourceOrLibrary(allsrc, mpackage.getRootsrc());
        break;
      case LIBRARY:
        MindRootSrc rs = (MindRootSrc) resolvedBy;
        addSourceOrLibrary(allsrc, rs);
        break;
      case PROJECT:
        MindProject mp = (MindProject) resolvedBy;
        if (mp != currentProject) allsrc.addAll(mp.getAllsrc());
        break;
      case SOURCE:
        rs = (MindRootSrc) resolvedBy;
        addSourceOrLibrary(allsrc, rs);
        break;

      default:
        break;
    }
  }
Esempio n. 2
0
 @Override
 public EList<MindLibOrProject> getUses() {
   BasicEList<MindLibOrProject> ret = new BasicEList<MindLibOrProject>();
   for (MindPathEntry mpe : mindpathentries) {
     MindObject resolvedObject = mpe.getResolvedBy();
     if (resolvedObject == null) continue;
     MindLibOrProject mp = null;
     if (resolvedObject instanceof MindRootSrc) {
       MindRootSrc s = (MindRootSrc) resolvedObject;
       mp = s.getProject();
     } else if (resolvedObject instanceof MindPackage) {
       MindPackage mdPacakage = (MindPackage) resolvedObject;
       MindRootSrc s = mdPacakage.getRootsrc();
       if (s == null) continue;
       mp = s.getProject();
     } else if (resolvedObject instanceof MindProject) {
       mp = (MindProject) resolvedObject;
     }
     if (mp == null || ret.contains(mp)) continue;
     ret.add(mp);
   }
   return ret;
 }