All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.izforge.izpack.panels.jdkpath.JDKPathPanelAutomationHelper Maven / Gradle / Ivy

There is a newer version: 5.2.2
Show newest version
package com.izforge.izpack.panels.jdkpath;

import com.izforge.izpack.api.adaptator.IXMLElement;
import com.izforge.izpack.api.adaptator.impl.XMLElementImpl;
import com.izforge.izpack.api.data.InstallData;
import com.izforge.izpack.api.data.Overrides;
import com.izforge.izpack.api.exception.InstallerException;
import com.izforge.izpack.installer.automation.PanelAutomation;
import com.izforge.izpack.installer.automation.PanelAutomationHelper;

public class JDKPathPanelAutomationHelper extends PanelAutomationHelper implements PanelAutomation
{
    @Override
    public void createInstallationRecord(InstallData installData, IXMLElement rootElement)
    {
        String jdkVarName = installData.getVariable("jdkVarName");
        String jdkPathName = installData.getVariable(jdkVarName);

        IXMLElement jdkPath = new XMLElementImpl("jdkPath", rootElement);
        jdkPath.setContent(jdkPathName);
        rootElement.addChild(jdkPath);

        IXMLElement jdkVar = new XMLElementImpl("jdkVarName", rootElement);
        jdkVar.setContent(jdkVarName);
        rootElement.addChild(jdkVar);
    }

    @Override
    public void runAutomated(InstallData installData, IXMLElement panelRoot) throws InstallerException
    {
        IXMLElement jdkPathElement = panelRoot.getFirstChildNamed("jdkPath");
        String jdkPath = jdkPathElement.getContent();

        IXMLElement jdkVarNameElement = panelRoot.getFirstChildNamed("jdkVarName");
        String jdkVarName = jdkVarNameElement.getContent();

        installData.setVariable(jdkVarName, jdkPath);
    }

    @Override
    public void processOptions(InstallData installData, Overrides overrides) {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy