com.izforge.izpack.uninstaller
Class UninstallerConsole.DestroyerHandler

java.lang.Object
  extended by com.izforge.izpack.uninstaller.UninstallerConsole.DestroyerHandler
All Implemented Interfaces:
AbstractUIHandler, AbstractUIProgressHandler
Enclosing class:
UninstallerConsole

private final class UninstallerConsole.DestroyerHandler
extends java.lang.Object
implements AbstractUIProgressHandler

The destroyer handler.

This class also implements the InstallListener because the FileExecutor needs it. TODO: get rid of the InstallListener - implement generic Listener


Field Summary
private  int AUTO_ANSWER_MODE
           
 
Fields inherited from interface com.izforge.izpack.util.AbstractUIHandler
ANSWER_CANCEL, ANSWER_NO, ANSWER_YES, CHOICES_YES_NO, CHOICES_YES_NO_CANCEL
 
Constructor Summary
private UninstallerConsole.DestroyerHandler()
           
 
Method Summary
private  boolean askOKCancel(java.lang.String question, int defaultchoice)
           
 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.
private  int askYesNo(java.lang.String question, int defaultchoice)
           
private  int askYesNoCancel(java.lang.String question, int defaultchoice)
           
 void emitError(java.lang.String title, java.lang.String error)
          The destroyer encountered an error.
 void emitNotification(java.lang.String text)
          Output a notification.
 boolean emitWarning(java.lang.String title, java.lang.String text)
          Output a warning.
 void nextStep(java.lang.String step_name, int step_no, int no_of_substeps)
          The next step starts.
private  void out(java.lang.String str)
           
 void progress(int pos, java.lang.String message)
          The destroyer progresses.
private  java.lang.String read()
           
private  java.lang.String readln()
           
 void setSubStepNo(int no_of_substeps)
          Set the number of substeps.
 void startAction(java.lang.String name, int max)
          The destroyer starts.
 void stopAction()
          The destroyer stops.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTO_ANSWER_MODE

private int AUTO_ANSWER_MODE
Constructor Detail

UninstallerConsole.DestroyerHandler

private UninstallerConsole.DestroyerHandler()
Method Detail

out

private void out(java.lang.String str)

askOKCancel

private boolean askOKCancel(java.lang.String question,
                            int defaultchoice)

askYesNoCancel

private int askYesNoCancel(java.lang.String question,
                           int defaultchoice)

askYesNo

private int askYesNo(java.lang.String question,
                     int defaultchoice)

read

private java.lang.String read()
                       throws java.lang.Exception
Throws:
java.lang.Exception

readln

private java.lang.String readln()
                         throws java.lang.Exception
Throws:
java.lang.Exception

startAction

public void startAction(java.lang.String name,
                        int max)
The destroyer starts.

Specified by:
startAction in interface AbstractUIProgressHandler
Parameters:
name - The name of the overall action. Not used here.
max - The maximum value of the progress.

stopAction

public void stopAction()
The destroyer stops.

Specified by:
stopAction in interface AbstractUIProgressHandler

progress

public void progress(int pos,
                     java.lang.String message)
The destroyer progresses.

Specified by:
progress in interface AbstractUIProgressHandler
Parameters:
pos - The actual position.
message - The message.

nextStep

public void nextStep(java.lang.String step_name,
                     int step_no,
                     int no_of_substeps)
Description copied from interface: AbstractUIProgressHandler
The next step starts.

Specified by:
nextStep in interface AbstractUIProgressHandler
Parameters:
step_name - The name of the step which starts now.
step_no - The number of the step.
no_of_substeps - 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.

emitNotification

public void emitNotification(java.lang.String text)
Output a notification.

Does nothing here.

Specified by:
emitNotification in interface AbstractUIHandler
Parameters:
text -

emitWarning

public boolean emitWarning(java.lang.String title,
                           java.lang.String text)
Output a warning.

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

emitError

public void emitError(java.lang.String title,
                      java.lang.String error)
The destroyer encountered an error.

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

askQuestion

public int askQuestion(java.lang.String title,
                       java.lang.String question,
                       int choices)
Ask the user a question.

Specified by:
askQuestion in interface AbstractUIHandler
Parameters:
title - Message title.
question - The question.
choices - The set of choices to present.
Returns:
The user's choice.
See Also:
AbstractUIHandler.askQuestion(String, String, int)

askQuestion

public int askQuestion(java.lang.String title,
                       java.lang.String question,
                       int choices,
                       int default_choice)
Ask the user a question.

Specified by:
askQuestion in interface AbstractUIHandler
Parameters:
title - Message title.
question - The question.
choices - The set of choices to present.
default_choice - The default choice. (-1 = no default choice)
Returns:
The user's choice.
See Also:
AbstractUIHandler.askQuestion(String, String, int, int)