/** * Determines if the desktop shortcut checkbox is enabled. * * @return {@code true} if the desktop shortcut checkbox is enabled */ public boolean isDesktopShortcutCheckboxSelected() { return Boolean.valueOf(installData.getVariable("DesktopShortcutCheckboxEnabled")); }
private void handleInstallPath(InstallData installData, String path) { // Allow for variable substitution of the installpath value path = installData.getVariables().replace(path); if (TargetPanelHelper.isIncompatibleInstallation(path, installData.getInfo().isReadInstallationInformation())) { throw new InstallerException(installData.getMessages().get("TargetPanel.incompatibleInstallation")); } installData.setInstallPath(path); } }
/** * MUST always be called in constructor of JDKPathConsolePanel and JDKPathPanel * @param installData */ public static void initialize(InstallData installData) { minVersion = installData.getVariable("JDKPathPanel.minVersion"); maxVersion = installData.getVariable("JDKPathPanel.maxVersion"); installData.setVariable(JDK_VAR_NAME, JDK_PATH); }
private void handleInstallPath(InstallData installData, String path) { // Allow for variable substitution of the installpath value path = installData.getVariables().replace(path); installData.setInstallPath(path); } }
public PacksModel(InstallData idata) { this.installData = idata; this.rules = idata.getRules(); try{ this.messages = idata.getMessages().newMessages(Resources.PACK_TRANSLATIONS_RESOURCE_NAME); } catch(ResourceNotFoundException ex){ this.messages=idata.getMessages(); } this.variables = idata.getVariables(); this.packsToInstall = idata.getSelectedPacks(); this.modifyInstallation = Boolean.valueOf(idata.getVariable(InstallData.MODIFY_INSTALLATION)); this.installedPacks = loadInstallationInformation(modifyInstallation); this.packs = getVisiblePacks(); this.hiddenPacks = getHiddenPacks(); this.nameToRow = getNametoRowMapping(packs); this.nameToPack = getNametoPackMapping(idata.getAvailablePacks()); this.packs = setPackProperties(packs, nameToPack); this.checkValues = initCheckValues(packs, packsToInstall); updateConditions(true); updatePacksToInstall(); }
/** * Constructs a {@code FieldReader}. * * @param field the field element to read * @param config the configuration */ public ButtonFieldReader(IXMLElement field, Config config, InstallData installData) { super(field, config); this.installData = installData; this.messages = installData.getMessages(); }
@Override public boolean isTrue() { InstallData installData = getInstallData(); if (installData != null) { String val = installData.getVariable(variablename); if (val == null) { return false; } else { Variables variables = installData.getVariables(); return variables.replace(val).equals(variables.replace(value)); } } else { return false; } }
File installInfo = new File(installData.getInstallPath(), InstallData.INSTALLATION_INFORMATION); try removeAlreadyInstalledPacks(installData.getSelectedPacks(), readPacks); logger.fine("Found " + packsinstalled.size() + " installed packs"); for (Object key : variables.keySet()) installData.setVariable((String) key, (String) variables.get(key));
RulesEngine rules = idata.getRules(); for (Pack pack : idata.getAvailablePacks()) final int indexOfAvailablePack = idata.getAvailablePacks().indexOf(pack); for (PInfo packInfo : autoinstallPackInfoList) if (!packInfo.isSelected() && rules.canInstallPack(pack.getName(), idata.getVariables())) else if (!rules.canInstallPack(pack.getName(), idata.getVariables())) idata.getSelectedPacks().remove(pack); logger.fine("Pack [" + packInfo.toString() + "] removed from selection."); if (idata.getSelectedPacks().indexOf(pack) < 0 && rules.canInstallPack(pack.getName(), idata.getVariables())) idata.getSelectedPacks().add(pack); logger.fine("Pack [" + packInfo.toString() + "] added to selection."); idata.getSelectedPacks().remove(pack); logger.fine("Pack [" + packInfo.toString() + "] removed from selection.");
if (installData.getRules().canInstallPack(pack, installData.getVariables())) boolean contained = installData.getSelectedPacks().contains(p); String cbView = contained ? "x" : " "; if (askUser(" ["+ cbView +"] Include optional pack '" + packName + "'", (contained ? Option.YES : Option.NO)))
public void setValue(final InstallData installData, final String value) { installData.setVariable(key, value); }
@Override public void runAutomated(InstallData idata, IXMLElement panelRoot) { // We set the installation path IXMLElement ipath = panelRoot.getFirstChildNamed(UserPathPanel.pathElementName); // Allow for variable substitution of the installpath value if (ipath != null) { String path = ipath.getContent(); path = idata.getVariables().replace(path); idata.setVariable(UserPathPanel.pathVariableName, path); } }
String currentPath = installData.getInstallPath(); if (currentPath != null) String defaultPath = installData.getDefaultInstallPath(); if (defaultPath == null) if (path != null) path = installData.getVariables().replace(path); path = installData.getVariables().replace(defaultPath);
/** * @return the suggested program group */ public String getSuggestedProgramGroup() { return installData.getVariables().replace(suggestedProgramGroup); }
/** * Determines if an existing directory can be written to. * * @param dir the directory * @return {@code true} if the directory can be written to, otherwise {@code false} */ protected boolean checkOverwrite(File dir, Console console) { boolean result = true; // if 'ShowExistingDirectoryWarning' configuration option set 'false' then don't show // "The directory already exists! Are you sure you want to install here and possibly overwrite existing files?" // warning dialog: String show = getPanel().getConfigurationOptionValue(PathInputBase.SHOWEXISTINGDIRECTORYWARNING, installData.getRules()); if ((show == null || Boolean.getBoolean(show)) && dir.isDirectory() && dir.list().length > 0) { Messages messages = installData.getMessages(); result = askUser(messages.get("installer.warning"), messages.get("TargetPanel.warn"), Prompt.Option.NO); } return result; }
@Override public boolean run(InstallData installData, Properties properties) { boolean result = false; String path = properties.getProperty(InstallData.INSTALL_PATH); if (path == null || "".equals(path.trim())) { System.err.println("Missing mandatory target path!"); } else if (TargetPanelHelper.isIncompatibleInstallation(path, installData.getInfo().isReadInstallationInformation())) { System.err.println(getIncompatibleInstallationMsg(installData)); } else { path = installData.getVariables().replace(path); installData.setInstallPath(path); result = true; } return result; }
/** * Returns the rules. * * @return the rules */ private RulesEngine getRules() { return installData.getRules(); }
/** * Resolve a filename with Project's help - if we know one that is. * <p/> * <p>Assume the filename is absolute if project is null.</p> */ private static String resolveFile(InstallData idata, String relativeName) throws Exception { File f = FileUtils.resolveFile(new File(idata.getInstallPath()), relativeName); return f.getAbsolutePath(); }
text = installData.getVariables().replace(text); if (text != null) RulesEngine rules = installData.getRules(); boolean paging = Boolean.parseBoolean(panel.getConfigurationOptionValue("console-text-paging", rules)); boolean wordwrap = Boolean.parseBoolean(panel.getConfigurationOptionValue("console-text-wordwrap", rules));
private boolean expired() { Date expiresDate = installData.getInfo().getExpiresDate(); return new Date().after(expiresDate); }