com.izforge.izpack.panels
Class InstallPanelConsoleHelper

java.lang.Object
  extended by com.izforge.izpack.installer.PanelConsoleHelper
      extended by com.izforge.izpack.panels.InstallPanelConsoleHelper
All Implemented Interfaces:
PanelConsole, AbstractUIHandler, AbstractUIProgressHandler
Direct Known Subclasses:
ExtendedInstallPanelConsoleHelper

public class InstallPanelConsoleHelper
extends PanelConsoleHelper
implements PanelConsole, AbstractUIProgressHandler

Install Panel console helper

Author:
Mounir el hajj

Field Summary
private  int noOfPacks
           
 
Fields inherited from interface com.izforge.izpack.util.AbstractUIHandler
ANSWER_CANCEL, ANSWER_NO, ANSWER_YES, CHOICES_YES_NO, CHOICES_YES_NO_CANCEL
 
Constructor Summary
InstallPanelConsoleHelper()
           
 
Method Summary
 int askQuestion(java.lang.String title, java.lang.String question, int choices)
          Ask the user a question.
 int askQuestion(java.lang.String title, java.lang.String question, int choices, int default_choice)
          Ask the user a question.
 void emitError(java.lang.String title, java.lang.String message)
          Notify the user of some error.
 void emitErrorAndBlockNext(java.lang.String title, java.lang.String message)
          Notify the user of some error and block the next button.
 void emitNotification(java.lang.String message)
          Notify the user about something.
 boolean emitWarning(java.lang.String title, java.lang.String message)
          Warn the user about something.
 void nextStep(java.lang.String packName, int stepno, int stepsize)
          The next step starts.
 void progress(int val, java.lang.String msg)
          Notify of progress.
 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
 void setSubStepNo(int no_of_substeps)
          Set the number of substeps.
 void startAction(java.lang.String name, int no_of_steps)
          The action starts.
 void stopAction()
          The action was finished.
 
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

noOfPacks

private int noOfPacks
Constructor Detail

InstallPanelConsoleHelper

public InstallPanelConsoleHelper()
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 *

emitNotification

public void emitNotification(java.lang.String message)
Description copied from interface: AbstractUIHandler
Notify the user about something.

The difference between notification and warning is that a notification should not need user interaction and can savely be ignored.

Specified by:
emitNotification in interface AbstractUIHandler
Parameters:
message - The notification.

emitWarning

public boolean emitWarning(java.lang.String title,
                           java.lang.String message)
Description copied from interface: AbstractUIHandler
Warn the user about something.

Specified by:
emitWarning in interface AbstractUIHandler
Parameters:
title - The message title (used for dialog name, might not be displayed)
message - The warning message.
Returns:
true if the user decided to continue

emitError

public void emitError(java.lang.String title,
                      java.lang.String message)
Description copied from interface: AbstractUIHandler
Notify the user of some error.

Specified by:
emitError in interface AbstractUIHandler
Parameters:
title - The message title (used for dialog name, might not be displayed)
message - The error message.

emitErrorAndBlockNext

public void emitErrorAndBlockNext(java.lang.String title,
                                  java.lang.String message)
Description copied from interface: AbstractUIHandler
Notify the user of some error and block the next button.

Specified by:
emitErrorAndBlockNext in interface AbstractUIHandler
Parameters:
title - The message title (used for dialog name, might not be displayed)
message - The error message.

askQuestion

public int askQuestion(java.lang.String title,
                       java.lang.String question,
                       int choices)
Description copied from interface: AbstractUIHandler
Ask the user a question.

Specified by:
askQuestion in interface AbstractUIHandler
Parameters:
title - The title of the question (useful for dialogs). Might be null.
question - The question.
choices - The set of choices to present. Either CHOICES_YES_NO or CHOICES_YES_NO_CANCEL
Returns:
The user's choice. (ANSWER_CANCEL, ANSWER_YES or ANSWER_NO)

askQuestion

public int askQuestion(java.lang.String title,
                       java.lang.String question,
                       int choices,
                       int default_choice)
Description copied from interface: AbstractUIHandler
Ask the user a question.

Specified by:
askQuestion in interface AbstractUIHandler
Parameters:
title - The title of the question (useful for dialogs). Might be null.
question - The question.
choices - The set of choices to present. Either CHOICES_YES_NO or CHOICES_YES_NO_CANCEL
default_choice - The default choice. One of ANSWER_CANCEL, ANSWER_YES or ANSWER_NO.
Returns:
The user's choice. (ANSWER_CANCEL, ANSWER_YES or ANSWER_NO)

startAction

public void startAction(java.lang.String name,
                        int no_of_steps)
Description copied from interface: AbstractUIProgressHandler
The action starts.

Specified by:
startAction in interface AbstractUIProgressHandler
Parameters:
name - The name of the action.
no_of_steps - The number of steps the action consists of.

stopAction

public void stopAction()
Description copied from interface: AbstractUIProgressHandler
The action was finished.

Specified by:
stopAction in interface AbstractUIProgressHandler

progress

public void progress(int val,
                     java.lang.String msg)
Description copied from interface: AbstractUIProgressHandler
Notify of progress.

Specified by:
progress in interface AbstractUIProgressHandler
Parameters:
val - The substep which will be performed next.
msg - An additional message describing the substep.

nextStep

public void nextStep(java.lang.String packName,
                     int stepno,
                     int stepsize)
Description copied from interface: AbstractUIProgressHandler
The next step starts.

Specified by:
nextStep in interface AbstractUIProgressHandler
Parameters:
packName - The name of the step which starts now.
stepno - The number of the step.
stepsize - The number of sub-steps this step consists of.

setSubStepNo

public void setSubStepNo(int no_of_substeps)
Description copied from interface: AbstractUIProgressHandler
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.