org.rimudb.editor.swing
Class OptionPane

java.lang.Object
  extended by org.rimudb.editor.swing.OptionPane

public class OptionPane
extends java.lang.Object

This class is similar to javax.swing.JOptionPane, but it allows message text to be wrapped to a given width within the dialog box.

Author:
Simon Ritchie

Constructor Summary
OptionPane()
           
 
Method Summary
static int showConfirmMessage(java.awt.Component parentComponent, java.lang.String message)
          Show a confirmation message.
static int showConfirmMessage(java.awt.Component parentComponent, java.lang.String message, int optionType)
          Show a confirmation message.
static int showConfirmMessage(java.awt.Component parentComponent, java.lang.String message, java.lang.String title, int columns)
          Show a confirmation message.
static int showConfirmMessage(java.awt.Component parentComponent, java.lang.String message, java.lang.String title, int columns, int optionType)
          Show a confirmation message.
static void showErrorMessage(java.awt.Component parentComponent, java.lang.String message)
          Show an error message.
static void showErrorMessage(java.awt.Component parentComponent, java.lang.String message, int columns)
          Show an error message.
static void showErrorMessage(java.awt.Component parentComponent, java.lang.String message, java.lang.String title, int columns)
          Show an error message.
static void showErrorMessage(java.awt.Component parentComponent, ValidationMessage[] messages)
          Show validation messages in an error option pane.
static void showErrorMessage(java.awt.Component parentComponent, ValidationMessage[] messages, int maxColumnWidth)
          Show validation messages in an error option pane.
static void showInfoMessage(java.awt.Component parentComponent, java.lang.String message)
          Show an informational message.
static void showInfoMessage(java.awt.Component parentComponent, java.lang.String message, java.lang.String title, int columns)
          Show an informational message.
static void showWarningMessage(java.awt.Component parentComponent, ValidationMessage[] messages)
          Show a warning message.
static int showYesNoConfirmMessage(java.awt.Component parentComponent, java.lang.String message, java.lang.String title, int columns)
          Show a Yes/No confirmation message.
static java.lang.String[] wrapText(java.lang.String text, java.awt.FontMetrics fm, int lineWidth)
          Convert the text into an array of Strings with each String having no more than lineWidth characters.
static java.lang.String[] wrapText(java.lang.String text, int lineWidth)
          Convert the text into an array of Strings with each String having no more than lineWidth characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionPane

public OptionPane()
Method Detail

showErrorMessage

public static void showErrorMessage(java.awt.Component parentComponent,
                                    ValidationMessage[] messages)
Show validation messages in an error option pane.

Parameters:
parentComponent - Component
messages - ValidationMessage[]

showErrorMessage

public static void showErrorMessage(java.awt.Component parentComponent,
                                    ValidationMessage[] messages,
                                    int maxColumnWidth)
Show validation messages in an error option pane.

Parameters:
parentComponent - Component
messages - ValidationMessage[]
maxColumnWidth - int

showErrorMessage

public static void showErrorMessage(java.awt.Component parentComponent,
                                    java.lang.String message)
Show an error message.

Parameters:
parentComponent - Component
message - String

showErrorMessage

public static void showErrorMessage(java.awt.Component parentComponent,
                                    java.lang.String message,
                                    int columns)
Show an error message.

Parameters:
parentComponent - Component
message - String
columns - int

showInfoMessage

public static void showInfoMessage(java.awt.Component parentComponent,
                                   java.lang.String message)
Show an informational message.

Parameters:
parentComponent - Component
message - String

showInfoMessage

public static void showInfoMessage(java.awt.Component parentComponent,
                                   java.lang.String message,
                                   java.lang.String title,
                                   int columns)
Show an informational message.

Parameters:
parentComponent - Component
message - String
title - String
columns - int

showConfirmMessage

public static int showConfirmMessage(java.awt.Component parentComponent,
                                     java.lang.String message)
Show a confirmation message.

Parameters:
parentComponent - Component
message - String
Returns:
int

showConfirmMessage

public static int showConfirmMessage(java.awt.Component parentComponent,
                                     java.lang.String message,
                                     int optionType)
Show a confirmation message.

Parameters:
parentComponent - Component
message - String
optionType - int
Returns:
int

showConfirmMessage

public static int showConfirmMessage(java.awt.Component parentComponent,
                                     java.lang.String message,
                                     java.lang.String title,
                                     int columns)
Show a confirmation message.

Parameters:
parentComponent - Component
message - String
title - String
columns - int
Returns:
int

showYesNoConfirmMessage

public static int showYesNoConfirmMessage(java.awt.Component parentComponent,
                                          java.lang.String message,
                                          java.lang.String title,
                                          int columns)
Show a Yes/No confirmation message.

Parameters:
parentComponent - Component
message - String
title - String
columns - int
Returns:
int

showConfirmMessage

public static int showConfirmMessage(java.awt.Component parentComponent,
                                     java.lang.String message,
                                     java.lang.String title,
                                     int columns,
                                     int optionType)
Show a confirmation message.

Parameters:
parentComponent - Component
message - String
title - String
columns - int
optionType - int
Returns:
int

showErrorMessage

public static void showErrorMessage(java.awt.Component parentComponent,
                                    java.lang.String message,
                                    java.lang.String title,
                                    int columns)
Show an error message.

Parameters:
parentComponent - Component
message - String
title - String
columns - int

wrapText

public static java.lang.String[] wrapText(java.lang.String text,
                                          int lineWidth)
Convert the text into an array of Strings with each String having no more than lineWidth characters.

Parameters:
text - String
lineWidth - int
Returns:
String[]

wrapText

public static java.lang.String[] wrapText(java.lang.String text,
                                          java.awt.FontMetrics fm,
                                          int lineWidth)
Convert the text into an array of Strings with each String having no more than lineWidth characters.

Parameters:
text - String
fm - FontMetrics
lineWidth - int
Returns:
String[]

showWarningMessage

public static void showWarningMessage(java.awt.Component parentComponent,
                                      ValidationMessage[] messages)
Show a warning message.

Parameters:
parentComponent - Component
messages - ValidationMessage[]


Copyright © 2008-2011 Simon Ritchie. All Rights Reserved.