com.izforge.izpack.panels
Class CompilePanelAutomationHelper

java.lang.Object
  extended by com.izforge.izpack.installer.PanelAutomationHelper
      extended by com.izforge.izpack.panels.CompilePanelAutomationHelper
All Implemented Interfaces:
CompileHandler, PanelAutomation, AbstractUIHandler, AbstractUIProgressHandler

public class CompilePanelAutomationHelper
extends PanelAutomationHelper
implements PanelAutomation, CompileHandler

Functions to support automated usage of the CompilePanel

Author:
Jonathan Halliday, Tino Schwarze

Field Summary
private  int job_max
           
private  java.lang.String job_name
           
private  int last_line_len
           
private  java.io.PrintStream stderr
           
private  java.io.PrintStream stdout
           
private  CompileWorker worker
           
 
Fields inherited from interface com.izforge.izpack.util.AbstractUIHandler
ANSWER_CANCEL, ANSWER_NO, ANSWER_YES, CHOICES_YES_NO, CHOICES_YES_NO_CANCEL
 
Constructor Summary
CompilePanelAutomationHelper()
           
 
Method Summary
 void handleCompileError(CompileResult error)
          Reports the error to System.err
 void makeXMLData(AutomatedInstallData installData, XMLElement panelRoot)
          Save data for running automated.
 void nextStep(java.lang.String jobName, int max, int jobNo)
          Reports progress to System.out
 void progress(int val, java.lang.String msg)
          Tell about progress.
 boolean runAutomated(AutomatedInstallData idata, XMLElement panelRoot)
          Perform the installation actions.
 void setSubStepNo(int no_of_substeps)
          Set the number of substeps.
 void startAction(java.lang.String name, int noOfJobs)
          Reports progress on System.out
 void stopAction()
          Sets state variable for thread sync.
 
Methods inherited from class com.izforge.izpack.installer.PanelAutomationHelper
askQuestion, askQuestion, emitError, emitNotification, emitWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.izforge.izpack.util.AbstractUIHandler
askQuestion, askQuestion, emitError, emitNotification, emitWarning
 

Field Detail

worker

private CompileWorker worker

job_max

private int job_max

job_name

private java.lang.String job_name

last_line_len

private int last_line_len

stdout

private java.io.PrintStream stdout

stderr

private java.io.PrintStream stderr
Constructor Detail

CompilePanelAutomationHelper

public CompilePanelAutomationHelper()
Method Detail

makeXMLData

public void makeXMLData(AutomatedInstallData installData,
                        XMLElement panelRoot)
Save data for running automated.

Specified by:
makeXMLData in interface PanelAutomation
Parameters:
installData - installation parameters
panelRoot - unused.

runAutomated

public boolean runAutomated(AutomatedInstallData idata,
                            XMLElement panelRoot)
Perform the installation actions.

Specified by:
runAutomated in interface PanelAutomation
Parameters:
panelRoot - The panel XML tree root.
idata - The installation data
Returns:
true if the automated work was performed successful, false if it failed critically.

startAction

public void startAction(java.lang.String name,
                        int noOfJobs)
Reports progress on System.out

Specified by:
startAction in interface AbstractUIProgressHandler
Parameters:
name - The name of the action.
noOfJobs - The number of steps the action consists of.
See Also:
AbstractUIProgressHandler.startAction(String, int)

handleCompileError

public void handleCompileError(CompileResult error)
Reports the error to System.err

Specified by:
handleCompileError in interface CompileHandler
Parameters:
error - the error
See Also:
CompileHandler.handleCompileError(CompileResult)

stopAction

public void stopAction()
Sets state variable for thread sync.

Specified by:
stopAction in interface AbstractUIProgressHandler
See Also:
AbstractUIProgressHandler.stopAction()

progress

public void progress(int val,
                     java.lang.String msg)
Tell about progress.

Specified by:
progress in interface AbstractUIProgressHandler
Parameters:
val -
msg -
See Also:
AbstractUIProgressHandler.progress(int, String)

nextStep

public void nextStep(java.lang.String jobName,
                     int max,
                     int jobNo)
Reports progress to System.out

Specified by:
nextStep in interface AbstractUIProgressHandler
Parameters:
jobName - The next job's name.
max - unused
jobNo - The next job's number.
See Also:
AbstractUIProgressHandler.nextStep(String, int, int)

setSubStepNo

public void setSubStepNo(int no_of_substeps)
Set the number of substeps.

This may be used if the number of substeps changes during an action.

Specified by:
setSubStepNo in interface AbstractUIProgressHandler
Parameters:
no_of_substeps - The number of substeps.