Exemplo n.º 1
0
 /**
  * The constructor.
  *
  * @param parent The parent window.
  * @param idata The installation installDataGUI.
  */
 public JDKPathPanel(
     InstallerFrame parent, GUIInstallData idata, ResourceManager resourceManager) {
   super(parent, idata, resourceManager);
   setMustExist(true);
   if (!OsVersion.IS_OSX) {
     setExistFiles(JDKPathPanel.testFiles);
   }
   setMinVersion(idata.getVariable("JDKPathPanel.minVersion"));
   setMaxVersion(idata.getVariable("JDKPathPanel.maxVersion"));
   setVariableName("JDKPath");
 }
Exemplo n.º 2
0
  public PacksModel(PacksPanelInterface panel, GUIInstallData idata, RulesEngine rules) {
    this.idata = idata;
    modifyinstallation = Boolean.valueOf(idata.getVariable(InstallData.MODIFY_INSTALLATION));
    this.installedpacks = new HashMap<String, Pack>();

    if (modifyinstallation) {
      // installation shall be modified
      // load installation information

      try {
        FileInputStream fin =
            new FileInputStream(
                new File(
                    idata.getInstallPath()
                        + File.separator
                        + InstallData.INSTALLATION_INFORMATION));
        ObjectInputStream oin = new ObjectInputStream(fin);
        List<Pack> packsinstalled = (List<Pack>) oin.readObject();
        for (Pack installedpack : packsinstalled) {
          if ((installedpack.getLangPackId() != null)
              && (installedpack.getLangPackId().length() > 0)) {
            this.installedpacks.put(installedpack.getLangPackId(), installedpack);
          } else {
            this.installedpacks.put(installedpack.getName(), installedpack);
          }
        }
        this.removeAlreadyInstalledPacks(idata.getSelectedPacks());
        logger.fine("Found " + packsinstalled.size() + " installed packs");

        Properties variables = (Properties) oin.readObject();

        for (Object key : variables.keySet()) {
          idata.setVariable((String) key, (String) variables.get(key));
        }
        fin.close();
      } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    this.rules = rules;

    this.packs = new ArrayList<Pack>();
    this.hiddenPacks = new ArrayList<Pack>();
    for (Pack availablePack : idata.getAvailablePacks()) {
      // only add a pack if not hidden
      if (!availablePack.isHidden()) {
        this.packs.add(availablePack);
      } else {
        this.hiddenPacks.add(availablePack);
      }
    }

    this.packsToInstall = idata.getSelectedPacks();
    this.panel = panel;
    variables = idata.getVariables();
    variables.set(INITAL_PACKSELECTION, Boolean.toString(true));
    messages = panel.getMessages();
    checkValues = new int[packs.size()];
    reverseDeps();
    initvalues();
    this.updateConditions(true);
    refreshPacksToInstall();
    variables.set(INITAL_PACKSELECTION, Boolean.toString(false));
  }