public List<String> getDependencies() { return pack.getDependencies(); }
public void addDependents(Pack p, Map<String, Pack> packsByName) { packNames.add(p.getName()); size += p.getSize(); if (p.getDependencies() == null || p.getDependencies().size() == 0) { return; } for (String dependent : p.getDependencies()) { if (!packNames.contains(dependent)) { Pack dependentPack = packsByName.get(dependent); addDependents(dependentPack, packsByName); } } }
protected void addDependents(Pack p, HashMap<String, Pack> packsByName, GroupData data) { data.packNames.add(p.getName()); data.size += p.getSize(); logger.fine("Added pack: " + p.getName()); if (p.getDependencies() == null || p.getDependencies().size() == 0) { return; } logger.fine(p.getName() + ", dependencies: " + p.getDependencies()); for (String dependent : p.getDependencies()) { if (!data.packNames.contains(dependent)) { logger.fine("Need dependent: " + dependent); Pack dependentPack = packsByName.get(dependent); addDependents(dependentPack, packsByName, data); } } }
/** * Computes pack related installDataGUI like the names or the dependencies state. * * @param packs The list of packs. */ private void computePacks(List<Pack> packs) { names = new HashMap<String, Pack>(); dependenciesExist = false; for (Pack pack : packs) { names.put(pack.getName(), pack); if (pack.getDependencies() != null || pack.getExcludeGroup() != null) { dependenciesExist = true; } } }
/** * Configure required packs. * @param name * @param checkValues * @return */ private List<CbSelectionState> propRequirement(String name, List<CbSelectionState> checkValues) { final int pos = getPos(name); checkValues.set(pos, CbSelectionState.REQUIRED_SELECTED); List<String> deps = packs.get(pos).getDependencies(); if (deps != null) { for (String s : deps) { return propRequirement(s, checkValues); } } return checkValues; }
/** * Check if a pack's dependencies are resolved. * @param pack * @return */ private boolean dependenciesResolved(Pack pack) { if(!pack.hasDependencies()) { return true; } for (String dependentPackName : pack.getDependencies()) { if (!isChecked(nameToRow.get(dependentPackName))) { return false; } } return true; } /**
java.util.List<String> dep = pack.getDependencies(); String list = ""; if (dep != null)
List<String> dep = pack.getDependencies(); String list = ""; if (dep != null)
/** * Ensure that parent packs know which packs are their children. * Ensure that packs who have dependants know which packs depend on them * * @param packs packs visible to the user * @param nameToPack mapping from pack names to pack objects * @return packs */ private List<Pack> setPackProperties(List<Pack> packs, Map<String, Pack> nameToPack) { Pack parent; for (Pack pack : packs) { if (pack.hasParent()) { String parentName = pack.getParent(); parent = nameToPack.get(parentName); parent.addChild(pack.getName()); } if (pack.hasDependencies()) { for (String name : pack.getDependencies()) { parent = nameToPack.get(name); parent.addDependant(pack.getName()); } } } return packs; }
for (String dependentPackName : pack.getDependencies())