Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.gui
Interface PopupDialog

All Superinterfaces:
ExportedWindow
All Known Implementing Classes:
PopupDialogImpl

public interface PopupDialog
extends ExportedWindow

A configurable popup dialog, that could be used from other services for simple interactions with the user, throught the gui interface. This dialog allows showing error, warning or info messages, prompting the user for simple one field input or choice, or asking the user for certain confirmation. Three types of dialogs are differentiated: Message, Confirm and Input dialog. Each of them has several show methods corresponging, allowing additional specific configuration, like specifying or not a title, confirmation option or initial value.

Author:
Yana Stamcheva

Field Summary
static int CANCEL_OPTION
          Return value from class method if CANCEL is chosen.
static int CLOSED_OPTION
          Return value from class method if user closes window without selecting anything.
static int ERROR_MESSAGE
          Used for error messages.
static int INFORMATION_MESSAGE
          Used for information messages.
static int NO_OPTION
          Return value from class method if NO is chosen.
static int OK_CANCEL_OPTION
          Type used for showConfirmDialog.
static int OK_OPTION
          Return value form class method if OK is chosen.
static int PLAIN_MESSAGE
          No icon is used.
static int QUESTION_MESSAGE
          Used for questions.
static int WARNING_MESSAGE
          Used for warning messages.
static WindowID WINDOW_GENERAL_POPUP
           
static int YES_NO_CANCEL_OPTION
          Type used for showConfirmDialog.
static int YES_NO_OPTION
          Type used for showConfirmDialog.
static int YES_OPTION
          Return value from class method if YES is chosen.
 
Fields inherited from interface net.java.sip.communicator.service.gui.ExportedWindow
ABOUT_WINDOW, ADD_CONTACT_WINDOW, CHAT_WINDOW, MAIN_WINDOW
 
Method Summary
 int showConfirmPopupDialog(Object message)
          Shows a dialog that prompts the user for confirmation.
 int showConfirmPopupDialog(Object message, String title, int optionType)
          Shows a dialog where the number of choices is determined by the optionType parameter.
 int showConfirmPopupDialog(Object message, String title, int optionType, int messageType)
          Shows a dialog where the number of choices is determined by the optionType parameter, where the messageType parameter determines the icon to display.
 int showConfirmPopupDialog(Object message, String title, int optionType, int messageType, byte[] icon)
          Implements the PopupDialog.showConfirmPopupDialog(Object, String, int, int) method.
 String showInputPopupDialog(Object message)
          Shows a question-message dialog requesting input from the user.
 String showInputPopupDialog(Object message, String initialSelectionValue)
          Shows a question-message dialog requesting input from the user, with the input value initialized to initialSelectionValue.
 String showInputPopupDialog(Object message, String title, int messageType)
          Shows a dialog with title title and message type messageType, requesting input from the user.
 Object showInputPopupDialog(Object message, String title, int messageType, Object[] selectionValues, Object initialSelectionValue)
          Shows an input dialog, where all options like title, type of message etc., could be configured.
 Object showInputPopupDialog(Object message, String title, int messageType, Object[] selectionValues, Object initialSelectionValue, byte[] icon)
          Implements the PopupDialog.showInputPopupDialog(Object, String, int, Object[], Object) method.
 void showMessagePopupDialog(Object message)
          Shows an information-message dialog titled "Message".
 void showMessagePopupDialog(Object message, String title, int messageType)
          Shows a dialog that displays a message using a default icon determined by the messageType parameter.
 void showMessagePopupDialog(Object message, String title, int messageType, byte[] icon)
          Implements the PopupDialog.showMessagePopupDialog(Object, String, int) method.
 
Methods inherited from interface net.java.sip.communicator.service.gui.ExportedWindow
bringToFront, getIdentifier, getSource, isFocused, isVisible, maximize, minimize, setLocation, setParams, setSize, setVisible
 

Field Detail

WINDOW_GENERAL_POPUP

static final WindowID WINDOW_GENERAL_POPUP

YES_NO_OPTION

static final int YES_NO_OPTION
Type used for showConfirmDialog.

See Also:
Constant Field Values

YES_NO_CANCEL_OPTION

static final int YES_NO_CANCEL_OPTION
Type used for showConfirmDialog.

See Also:
Constant Field Values

OK_CANCEL_OPTION

static final int OK_CANCEL_OPTION
Type used for showConfirmDialog.

See Also:
Constant Field Values

YES_OPTION

static final int YES_OPTION
Return value from class method if YES is chosen.

See Also:
Constant Field Values

NO_OPTION

static final int NO_OPTION
Return value from class method if NO is chosen.

See Also:
Constant Field Values

CANCEL_OPTION

static final int CANCEL_OPTION
Return value from class method if CANCEL is chosen.

See Also:
Constant Field Values

OK_OPTION

static final int OK_OPTION
Return value form class method if OK is chosen.

See Also:
Constant Field Values

CLOSED_OPTION

static final int CLOSED_OPTION
Return value from class method if user closes window without selecting anything.

See Also:
Constant Field Values

ERROR_MESSAGE

static final int ERROR_MESSAGE
Used for error messages.

See Also:
Constant Field Values

INFORMATION_MESSAGE

static final int INFORMATION_MESSAGE
Used for information messages.

See Also:
Constant Field Values

WARNING_MESSAGE

static final int WARNING_MESSAGE
Used for warning messages.

See Also:
Constant Field Values

QUESTION_MESSAGE

static final int QUESTION_MESSAGE
Used for questions.

See Also:
Constant Field Values

PLAIN_MESSAGE

static final int PLAIN_MESSAGE
No icon is used.

See Also:
Constant Field Values
Method Detail

showInputPopupDialog

String showInputPopupDialog(Object message)
Shows a question-message dialog requesting input from the user.

Parameters:
message - the Object to display.
Returns:
user's input, or null meaning the user canceled the input

showInputPopupDialog

String showInputPopupDialog(Object message,
                            String initialSelectionValue)
Shows a question-message dialog requesting input from the user, with the input value initialized to initialSelectionValue.

Parameters:
message - the Object to display
initialSelectionValue - the value used to initialize the input field
Returns:
user's input, or null meaning the user canceled the input

showInputPopupDialog

String showInputPopupDialog(Object message,
                            String title,
                            int messageType)
Shows a dialog with title title and message type messageType, requesting input from the user. The message type is meant to be used by the ui implementation to determine the icon of the dialog.

Parameters:
message - the Object to display
title - the String to display in the dialog title bar
messageType - the type of message that is to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
Returns:
user's input, or null meaning the user canceled the input

showInputPopupDialog

Object showInputPopupDialog(Object message,
                            String title,
                            int messageType,
                            Object[] selectionValues,
                            Object initialSelectionValue)
Shows an input dialog, where all options like title, type of message etc., could be configured. The user will be able to choose from selectionValues, where null implies the users can input whatever they wish. initialSelectionValue is the initial value to prompt the user with. It is up to the UI implementation to decide how best to represent the selectionValues. In the case of swing per example it could be a JComboBox, JList or JTextField. The message type is meant to be used by the ui implementation to determine the icon of the dialog.

Parameters:
message - the Object to display
title - the String to display in the dialog title bar
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
selectionValues - an array of Objects that gives the possible selections
initialSelectionValue - the value used to initialize the input field
Returns:
user's input, or null meaning the user canceled the input

showMessagePopupDialog

void showMessagePopupDialog(Object message)
Shows an information-message dialog titled "Message".

Parameters:
message - the Object to display

showMessagePopupDialog

void showMessagePopupDialog(Object message,
                            String title,
                            int messageType)
Shows a dialog that displays a message using a default icon determined by the messageType parameter.

Parameters:
message - the Object to display
title - the title string for the dialog
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE

showConfirmPopupDialog

int showConfirmPopupDialog(Object message)
Shows a dialog that prompts the user for confirmation.

Parameters:
message - the Object to display
Returns:
one of the YES_OPTION, NO_OPTION,.., XXX_OPTION, indicating the option selected by the user

showConfirmPopupDialog

int showConfirmPopupDialog(Object message,
                           String title,
                           int optionType)
Shows a dialog where the number of choices is determined by the optionType parameter.

Parameters:
message - the Object to display
title - the title string for the dialog
optionType - an int designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
Returns:
one of the YES_OPTION, NO_OPTION,.., XXX_OPTION, indicating the option selected by the user

showConfirmPopupDialog

int showConfirmPopupDialog(Object message,
                           String title,
                           int optionType,
                           int messageType)
Shows a dialog where the number of choices is determined by the optionType parameter, where the messageType parameter determines the icon to display. The messageType parameter is primarily used to supply a default icon for the dialog.

Parameters:
message - the Object to display
title - the title string for the dialog
optionType - an integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
messageType - an integer designating the kind of message this is; ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
Returns:
one of the YES_OPTION, NO_OPTION,.., XXX_OPTION, indicating the option selected by the user

showInputPopupDialog

Object showInputPopupDialog(Object message,
                            String title,
                            int messageType,
                            Object[] selectionValues,
                            Object initialSelectionValue,
                            byte[] icon)
Implements the PopupDialog.showInputPopupDialog(Object, String, int, Object[], Object) method. Invokes the corresponding JOptionPane.showInputDialog method.

Parameters:
message - the message to display
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
title - the String to display in the dialog title bar
selectionValues - an array of Objects that gives the possible selections
initialSelectionValue - the value used to initialize the input field
icon - the icon to show in the input window.

showMessagePopupDialog

void showMessagePopupDialog(Object message,
                            String title,
                            int messageType,
                            byte[] icon)
Implements the PopupDialog.showMessagePopupDialog(Object, String, int) method. Invokes the corresponding JOptionPane.showMessageDialog method.

Parameters:
message - the Object to display
title - the title string for the dialog
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
icon - the image to display in the message dialog.

showConfirmPopupDialog

int showConfirmPopupDialog(Object message,
                           String title,
                           int optionType,
                           int messageType,
                           byte[] icon)
Implements the PopupDialog.showConfirmPopupDialog(Object, String, int, int) method. Invokes the corresponding JOptionPane.showConfirmDialog method.

Parameters:
message - the Object to display
title - the title string for the dialog
optionType - an integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
messageType - an integer designating the kind of message this is; primarily used to determine the icon from the pluggable Look and Feel: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
icon - the icon to display in the dialog

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.