com.izforge.izpack.util
Interface AbstractUIHandler

All Known Subinterfaces:
AbstractUIProcessHandler, AbstractUIProgressHandler, CompileHandler
All Known Implementing Classes:
CheckedHelloPanel, CompilePanel, CompilePanelAutomationHelper, ConditionalUserInputPanel, DataCheckPanel, DefaultTargetPanel, ExtendedInstallPanel, FinishPanel, HelloPanel, HTMLInfoPanel, HTMLLicencePanel, ImgPacksPanel, InfoPanel, InstallationGroupPanel, InstallationTypePanel, InstallPanel, InstallPanelAutomationHelper, IzPanel, JDKPathPanel, LicencePanel, PacksPanel, PacksPanelBase, PanelAutomationHelper, PathInputPanel, ProcessPanel, ProcessPanelAutomationHelper, SelectPrinterPanel, ShortcutPanel, SimpleFinishPanel, SudoPanel, SummaryPanel, TargetPanel, TreePacksPanel, UninstallerConsole.DestroyerHandler, UninstallerFrame.DestroyerHandler, UserInputPanel, UserPathInputPanel, UserPathPanel, XInfoPanel

public interface AbstractUIHandler

This interface describes basic functionality neccessary for user interaction.

All methods or functions which perform work and need to notify or ask the user use a listener for such purposes. This way, we can separate UI from function.


Field Summary
static int ANSWER_CANCEL
           
static int ANSWER_NO
           
static int ANSWER_YES
           
static int CHOICES_YES_NO
           
static int CHOICES_YES_NO_CANCEL
           
 
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 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.
 

Field Detail

ANSWER_CANCEL

static final int ANSWER_CANCEL
See Also:
Constant Field Values

ANSWER_YES

static final int ANSWER_YES
See Also:
Constant Field Values

ANSWER_NO

static final int ANSWER_NO
See Also:
Constant Field Values

CHOICES_YES_NO

static final int CHOICES_YES_NO
See Also:
Constant Field Values

CHOICES_YES_NO_CANCEL

static final int CHOICES_YES_NO_CANCEL
See Also:
Constant Field Values
Method Detail

emitNotification

void emitNotification(java.lang.String message)
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.

Parameters:
message - The notification.

emitWarning

boolean emitWarning(java.lang.String title,
                    java.lang.String message)
Warn the user about something.

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

emitError

void emitError(java.lang.String title,
               java.lang.String message)
Notify the user of some error.

Parameters:
title - The message title (used for dialog name, might not be displayed)
message - The error message.

askQuestion

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

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

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

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)