private static void addSourceOrLibrary(EList<MindRootSrc> allsrc, MindRootSrc rs) { if (rs == null) return; if (allsrc.add(rs)) for (MindRootSrc drs : rs.getDependencies()) { addSourceOrLibrary(allsrc, drs); } }
@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; }