wt.clients.widgets
Class DialogFactory

java.lang.Object
  extended bywt.clients.widgets.DialogFactory

public class DialogFactory
extends Object

This is a modal dialog factory class for displaying error/confirmation messages


Field Summary
static int CANCEL_OPTION
           
static String cancelStr
           
static String errorStr
           
static int HELP_OPTION
           
static String helpStr
           
static String informStr
           
static int MAX
           
static int NO_OPTION
           
static String noStr
           
static String okStr
           
private static ResourceBundle resources
           
static String RESOURCES
           
static int YES_OPTION
           
static String yesStr
           
 
Constructor Summary
DialogFactory()
           
 
Method Summary
static String formatMessage(String msg, int max)
          Formats the string by placeing \n after max chars
static void showErrorDialog(Component parent, String msg)
          Error Dialog
static void showFormattedErrorDialog(Component parent, String msg)
          Error Dialog : this wraps around the string if it is longer than 80 chars
static void showFormattedInformDialog(Component parent, String msg)
           
static int showYesNoCancelDialog(Component parent, String msg, String title)
          Yes/no/cancel dialog the Yes button has the default focus
static int showYesNoDialog(Component parent, String msg, String title)
          Shows an yes/no dialog the Yes button has the default focus
static int showYesNoDialog(Component parent, String msg, String title, int defaultOption)
          Yes no dialog
static int showYesNoHelpDialog(Component parent, String msg, String title)
          Yes/no/help dialog the Yes button has the default focus
static int showYesNoHelpDialog(Component parent, String msg, String title, int defaultOption)
          Yes/no/help dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

okStr

public static String okStr

errorStr

public static String errorStr

informStr

public static String informStr

yesStr

public static String yesStr

noStr

public static String noStr

cancelStr

public static String cancelStr

helpStr

public static String helpStr

YES_OPTION

public static int YES_OPTION

NO_OPTION

public static int NO_OPTION

CANCEL_OPTION

public static int CANCEL_OPTION

HELP_OPTION

public static int HELP_OPTION

MAX

public static final int MAX
See Also:
Constant Field Values

RESOURCES

public static final String RESOURCES
See Also:
Constant Field Values

resources

private static ResourceBundle resources
Constructor Detail

DialogFactory

public DialogFactory()
Method Detail

showErrorDialog

public static void showErrorDialog(Component parent,
                                   String msg)
Error Dialog

Parameters:
parent - component
msg - error message

showFormattedErrorDialog

public static void showFormattedErrorDialog(Component parent,
                                            String msg)
Error Dialog : this wraps around the string if it is longer than 80 chars

Parameters:
parent - component
msg - the error message to be displayed

showYesNoDialog

public static int showYesNoDialog(Component parent,
                                  String msg,
                                  String title)
Shows an yes/no dialog the Yes button has the default focus

Parameters:
parent - component
msg - the message string
title - the title

showYesNoDialog

public static int showYesNoDialog(Component parent,
                                  String msg,
                                  String title,
                                  int defaultOption)
Yes no dialog

Parameters:
parent - component
msg - message string
title -
defaultOption - default focus option

showYesNoCancelDialog

public static int showYesNoCancelDialog(Component parent,
                                        String msg,
                                        String title)
Yes/no/cancel dialog the Yes button has the default focus

Parameters:
parent - component
msg - the message string
title - the title

showYesNoHelpDialog

public static int showYesNoHelpDialog(Component parent,
                                      String msg,
                                      String title)
Yes/no/help dialog the Yes button has the default focus

Parameters:
parent - component
msg - the message string
title - the title

showYesNoHelpDialog

public static int showYesNoHelpDialog(Component parent,
                                      String msg,
                                      String title,
                                      int defaultOption)
Yes/no/help dialog

Parameters:
parent - component
msg - message string
title -
defaultOption - default focus option

formatMessage

public static String formatMessage(String msg,
                                   int max)
Formats the string by placeing \n after max chars

Parameters:
msg - string
max - the max chars after which the string is to be wrapped around

showFormattedInformDialog

public static void showFormattedInformDialog(Component parent,
                                             String msg)