com.izforge.izpack.panels
Class JDKPathPanelConsoleHelper

java.lang.Object
  extended by com.izforge.izpack.installer.PanelConsoleHelper
      extended by com.izforge.izpack.panels.JDKPathPanelConsoleHelper
All Implemented Interfaces:
PanelConsole

public class JDKPathPanelConsoleHelper
extends PanelConsoleHelper
implements PanelConsole

The Target panel console helper class.

Author:
Mounir El Hajj

Field Summary
private  java.lang.String detectedVersion
           
private  java.lang.String maxVersion
           
private  java.lang.String minVersion
           
private  java.lang.String variableName
           
 
Constructor Summary
JDKPathPanelConsoleHelper()
           
 
Method Summary
private  boolean compareVersions(java.lang.String in, java.lang.String template, boolean isMin, int assumedPlace, int halfRange, java.lang.String useNotIdentifier)
           
private static boolean pathIsValid(java.lang.String strPath)
          Returns whether the chosen path is true or not.
private  java.lang.String resolveInRegistry(java.lang.String min, java.lang.String max)
          Returns the path to the needed JDK if found in the registry.
 boolean runConsole(AutomatedInstallData idata)
          Asks the panel to run in interactive console mode
 boolean runConsoleFromPropertiesFile(AutomatedInstallData installData, java.util.Properties p)
          Asks the panel to run and do its work, given a set of properties to use as variables
 boolean runGeneratePropertiesFile(AutomatedInstallData installData, java.io.PrintWriter printWriter)
          Asks the panel to return all inputed fields/variables in a string with a properties file style
private  boolean verifyVersion(java.lang.String min, java.lang.String max, java.lang.String path)
           
 
Methods inherited from class com.izforge.izpack.installer.PanelConsoleHelper
askEndOfConsolePanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minVersion

private java.lang.String minVersion

maxVersion

private java.lang.String maxVersion

variableName

private java.lang.String variableName

detectedVersion

private java.lang.String detectedVersion
Constructor Detail

JDKPathPanelConsoleHelper

public JDKPathPanelConsoleHelper()
Method Detail

runGeneratePropertiesFile

public boolean runGeneratePropertiesFile(AutomatedInstallData installData,
                                         java.io.PrintWriter printWriter)
Description copied from interface: PanelConsole
Asks the panel to return all inputed fields/variables in a string with a properties file style

Specified by:
runGeneratePropertiesFile in interface PanelConsole
Parameters:
installData - The installation data

runConsoleFromPropertiesFile

public boolean runConsoleFromPropertiesFile(AutomatedInstallData installData,
                                            java.util.Properties p)
Description copied from interface: PanelConsole
Asks the panel to run and do its work, given a set of properties to use as variables

Specified by:
runConsoleFromPropertiesFile in interface PanelConsole
Parameters:
installData - The installation data
p - The the properties

runConsole

public boolean runConsole(AutomatedInstallData idata)
Description copied from interface: PanelConsole
Asks the panel to run in interactive console mode

Specified by:
runConsole in interface PanelConsole
Parameters:
idata - The installation data *

pathIsValid

private static boolean pathIsValid(java.lang.String strPath)
Returns whether the chosen path is true or not. If existFiles are not null, the existence of it under the chosen path are detected. This method can be also implemented in derived classes to handle special verification of the path.

Returns:
true if existFiles are exist or not defined, else false

verifyVersion

private boolean verifyVersion(java.lang.String min,
                              java.lang.String max,
                              java.lang.String path)

compareVersions

private boolean compareVersions(java.lang.String in,
                                java.lang.String template,
                                boolean isMin,
                                int assumedPlace,
                                int halfRange,
                                java.lang.String useNotIdentifier)

resolveInRegistry

private java.lang.String resolveInRegistry(java.lang.String min,
                                           java.lang.String max)
Returns the path to the needed JDK if found in the registry. If there are more than one JDKs registered, that one with the highest allowd version will be returned. Works only on windows. On Unix an empty string returns.

Returns:
the path to the needed JDK if found in the windows registry