public String toString() { return pack.getName(); }
if (pack1.getExcludeGroup() != null && pack2.getExcludeGroup() != null) if (pack1.getExcludeGroup().equals(pack2.getExcludeGroup())) if (pack1.isPreselected() && pack2.isPreselected()) error("Packs " + pack1.getName() + " and " + pack2.getName() + " belong to the same excludeGroup " + pack1.getExcludeGroup() + " and are both preselected. This is not allowed.");
public void setpackTotal(int a, int b) { v[a] = new Pack(); v[a].total=b; }
public class Package { List<Pack> myList = new ArrayList<Pack>(); Pack obj; double total = 0; public double addPackage(int type, double num) { if (type == 1) { obj = new Pack(type, num); total = obj.calculateTotal(); } else { obj = new Pack(type, num); total = obj.calculateTotal(); } myList.add(obj); return total; } public int listSize() { return myList.size(); } }
/** * 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; } } }
pack.setFileSize(0); sendMsg("Writing Pack " + packNumber + ": " + pack.getName(), PackagerListener.MSG_VERBOSE); String streamResourceName = "packs/pack-" + pack.getName(); JarOutputStream packJar = installerJar; if (packSeparateJars()) String jarFile = getInfo().getInstallerBase() + ".pack-" + pack.getName() + ".jar"; packJar = getJarOutputStream(new File(jarFile)); entry = new ZipEntry(streamResourceName); boolean addFile = !pack.isLoose(); File file = packInfo.getFile(packFile); pack.addFileSize(packFile.length()); if (pack.getFileSize() > pack.getSize()) pack.setSize(pack.getFileSize()); child.setAttribute("name", pack.getName()); child.setAttribute("size", Long.toString(pack.getSize())); child.setAttribute("fileSize", Long.toString(pack.getFileSize())); if (pack.getLangPackId() != null) child.setAttribute("id", pack.getLangPackId());
/** * 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; }
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); } } }
if (checkValues[i] == CbSelectionState.DESELECTED) List<String> deps = pack.getDependants(); for (int j = 0; deps != null && j < deps.size(); j++) if (checkState != null && checkState.isFullyOrPartiallySelected() && pack.getExcludeGroup() != null) if (pack.getExcludeGroup().equals(otherPack.getExcludeGroup())) if (pack.isRequired()) checkValues = propRequirement(pack.getName(), Arrays.asList(checkValues)).toArray(new CbSelectionState[checkValues.length]);
pack.setDependants(null); if (!data.packNames.contains(pack.getName())) logger.fine("Removed available pack: " + pack.getName()); if (availablePack.isPreselected())
bytes = pack.getSize(); if(pack.hasChildren()) for(String childPackName : pack.getChildren()) bytes += childPack.getSize();//SOMETHING HERE node = nameToCheckBox.get(pack.getName());
marker, PackHelper.getPackName(pack, messages), pack.toByteUnitsString(pack.getSize())); if (pack.hasDependencies()) for (String dependentPackName : pack.getDependencies()) if (pack.hasChildren()) for (String childPackName : pack.getChildren()) if (pack.isRequired())
for (Pack pack : idata.getAvailablePacks()) packsByName.put(pack.getName(), pack); Set<String> groups = pack.getInstallGroups(); logger.fine("Pack: " + pack.getName() + ", installGroups: " + groups); for (String group : groups) for (Pack pack : idata.getAvailablePacks()) Set<String> groups = pack.getInstallGroups(); if (groups.size() == 0 || groups.contains(data.name)) if (!data.packNames.contains(pack.getName()))
/** * Returns a localised name for a pack. * <p/> * This uses {@link Pack#getLangPackId()} to locate the localised name for the pack. * <p/> * If no localised name exists, {@link Pack#getName()} will be returned. * * @param pack the pack * @param messages the messages. May be {@code null} * @return the pack name */ public static String getPackName(Pack pack, Messages messages) { String name = null; if (messages != null) { name = getMessage(pack.getLangPackId(), messages); } if (name == null || "".equals(name)) { name = pack.getName(); } return name; }
for (Pack pack : packsModel.getVisiblePacks()) if (pack.getParent() == null) rootNodes.add(populateTreePacks(pack.getName())); nameToCheckBox.put(checkBoxNode.getId(), checkBoxNode); checkBoxNode.setPack(pack); checkBoxNode.setTotalSize(pack.getSize()); return checkBoxNode; nameToCheckBox.put(checkBoxNode.getId(), checkBoxNode); checkBoxNode.setPack(pack); checkBoxNode.setTotalSize(pack.getSize()); return checkBoxNode;
String name = pack.getName(); if (rules.canInstallPack(name, variables) || rules.canInstallPackOptional(name, variables)) if (pack.isRequired()) if (pack.hasParent()) else if (pack.hasChildren())
if (pack.isRequired()) String name = pack.getName(); if (!(!rules.canInstallPack(name, variables) && rules.canInstallPackOptional(name, variables)))
private void updateBytes() { long bytes = 0; for (int q = 0; q < packs.size(); q++) { if (checkValues.get(q).isSelectedOrRequiredSelected()) { Pack pack = packs.get(q); bytes += pack.getSize(); } } // add selected hidden bytes for (Pack hidden : this.hiddenPacks) { if (this.rules.canInstallPack(hidden.getName(), variables)) { bytes += hidden.getSize(); } } panel.setBytes(bytes); }
/** * initializes built-in conditions like os conditions and package conditions. * * @param platform the current platform */ private void initStandardConditions(Platform platform) { logger.fine("Initializing built-in conditions"); initOsConditions(platform); if ((installData != null) && (installData.getAllPacks() != null)) { logger.fine("Initializing built-in conditions for packs"); for (Pack pack : installData.getAllPacks()) { // automatically add packselection condition PackSelectionCondition selectionCondition = new PackSelectionCondition(); selectionCondition.setInstallData(installData); selectionCondition.setId("izpack.selected." + pack.getName()); selectionCondition.setPack(pack.getName()); conditionsMap.put(selectionCondition.getId(), selectionCondition); String condition = pack.getCondition(); if (condition != null && !condition.isEmpty()) { logger.fine("Adding pack condition \"" + condition + "\" for pack \"" + pack.getName() + "\""); packConditions.put(pack.getName(), condition); } } } }