public String toString() { return pack.getName(); }
@Override public boolean equals(Object obj) { return super.equals(obj) || obj instanceof Pack && name.equals(((Pack) obj).getName()); } }
private boolean isTrue(List<Pack> selectedpacks) { if (selectedpacks != null) { for (Pack selectedpack : selectedpacks) { if (name.equals(selectedpack.getName())) { // pack is selected return true; } } } // pack is not selected return false; }
/** * 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 LinkedHashMap<String, Pack>(); for (Pack pack : packs) { names.put(pack.getName(), pack); } }
private int getActionCount(List<Pack> packs) { int count = 0; for (Pack pack : packs) { List<BSFAction> actList = actions.get(pack.getName()); if (actList != null) { count += actList.size(); } } return (count); }
/** * Generate a map from a pack's name to its pack object. * * @param packs list of pack objects * @return map from a pack's name to its pack object. */ private Map<String, Pack> getNametoPackMapping(List<Pack> packs) { Map <String, Pack> nameToPack = new HashMap<String, Pack>(); for (Pack pack : packs) { nameToPack.put(pack.getName(), pack); } return nameToPack; }
/** * Generate a map from a pack's name to its row number visible on the UI. * * @param packs list of pack objects * @return map from a pack's name to its row number visible on the UI */ private Map<String, Integer> getNametoRowMapping(List<Pack> packs) { Map<String, Integer> nameToPos = new HashMap<String, Integer>(); for (int i = 0; i < packs.size(); i++) { Pack pack = packs.get(i); nameToPos.put(pack.getName(), i); } return nameToPos; }
/** * Invoked after a pack is installed. * * @param pack the pack * @throws IzPackException for any error */ @Override public void afterPack(Pack pack) { performAllActions(pack.getName(), ActionBase.AFTERPACK, null); }
/** * Invoked before a pack is installed. * * @param pack the pack * @throws IzPackException for any error */ @Override public void beforePack(Pack pack) throws InstallerException { performAllActions(pack.getName(), ActionBase.BEFOREPACK, null); }
/** * Invoked after a pack is installed. * * @param pack the pack * @throws IzPackException for any error */ @Override public void afterPack(Pack pack) throws InstallerException { performAllActions(pack.getName(), ActionBase.AFTERPACK, null); }
/** * Invoked before a pack is installed. * * @param pack the pack * @throws IzPackException for any error */ @Override public void beforePack(Pack pack) { performAllActions(pack.getName(), ActionBase.BEFOREPACK, null); }
private int getActionCount(List<Pack> packs, String order) { int result = 0; for (Pack pack : packs) { String currentPack = pack.getName(); List<AntAction> actList = getActions(currentPack, order); if (actList != null) { result += actList.size(); } } return result; }
private int getActionCount(List<Pack> packs, String order) { int retval = 0; for (Pack pack : packs) { String currentPack = pack.getName(); List<ConfigurationAction> actList = getActions(currentPack, order); if (actList != null) { retval += actList.size(); } } return (retval); }
/** * Set the value of children packs to the same value as the parent pack. * * @param parentPack */ private void updateChildren(Pack parentPack) { String parentName = parentPack.getName(); int parentPosition = nameToRow.get(parentName); CbSelectionState parentValue = checkValues.get(parentPosition); for (String childName : parentPack.getChildren()) { int childPosition = nameToRow.get(childName); checkValues.set(childPosition, parentValue); } }
private void logAddingPack(PackInfo packInfo) { logger.log(Level.INFO, "Adding pack {0} containing {1} files", new String[]{packInfo.getPack().getName(), Integer.toString(packInfo.getPackFiles().size())}); }
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; } } }
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); } } }
@Override public void createInstallationRecord(InstallData installData, IXMLElement panelRoot) { // We add each pack to the panelRoot element for (int i = 0; i < installData.getAvailablePacks().size(); i++) { Pack pack = installData.getAvailablePacks().get(i); IXMLElement packElement = new XMLElementImpl("pack", panelRoot); packElement.setAttribute("index", Integer.toString(i)); packElement.setAttribute("name", pack.getName()); Boolean selected = installData.getSelectedPacks().contains(pack); packElement.setAttribute("selected", selected.toString()); panelRoot.addChild(packElement); } }
/** * Invoked after packs are installed. * * @param packs the installed packs * @param listener the progress listener * @throws IzPackException for any error */ @Override public void afterPacks(List<Pack> packs, ProgressListener listener) { if (notifyProgress()) { listener.nextStep(getMessage("ConfigurationAction.pack"), getProgressNotifierId(), getActionCount(packs, ActionBase.AFTERPACKS)); } for (Pack pack : packs) { String currentPack = pack.getName(); performAllActions(currentPack, ActionBase.AFTERPACKS, listener); } }