public interface MessageOutput
Definition of an interface for creating message boxes in a platform independent way.
This interface defines some constants representing the typical options
supported by message boxes, e.g. message type or available options. A main
show()
method is used to display the message box. Its result
value indicates the pressed button.
Concrete implementations will map the functionality provided by this
interface to GUI library specific classes. A Swing related implementation for
instance could use Swing's JOptionPane
to provide the required
functionality.
Modifier and Type | Field and Description |
---|---|
static int |
BTN_OK
Constant for the button type OK.
|
static int |
BTN_OK_CANCEL
Constant for the button type OK, CANCEL.
|
static int |
BTN_YES_NO
Constant for the button type YES, NO.
|
static int |
BTN_YES_NO_CANCEL
Constant for the button type YES, NO, CANCEL.
|
static int |
MESSAGE_ERROR
Constant for the message type ERROR.
|
static int |
MESSAGE_INFO
Constant for the message type INFO.
|
static int |
MESSAGE_PLAIN
Constant for the message type PLAIN.
|
static int |
MESSAGE_QUESTION
Constant for the message type QUESTION.
|
static int |
MESSAGE_WARNING
Constant for the message type WARNING.
|
static int |
RET_CANCEL
Constant for the return value CANCEL.
|
static int |
RET_NO
Constant for the return value NO.
|
static int |
RET_OK
Constant for the return value OK.
|
static int |
RET_YES
Constant for the return value YES.
|
static final int MESSAGE_ERROR
static final int MESSAGE_INFO
static final int MESSAGE_WARNING
static final int MESSAGE_QUESTION
static final int MESSAGE_PLAIN
static final int BTN_OK
static final int BTN_OK_CANCEL
static final int BTN_YES_NO
static final int BTN_YES_NO_CANCEL
static final int RET_OK
static final int RET_CANCEL
static final int RET_YES
RET_OK
return value. This is analogous to Swing.static final int RET_NO
int show(Window parent, Object message, String title, int messageType, int buttonType)
parent
- the parent windowmessage
- the message itself; can be an arbitrary object whose
toString()
method will be used to obtain the text to be
displayedtitle
- the message box's titlemessageType
- the type of the message; this must be one the
MESSAGE_XXXX
constantsbuttonType
- defines the buttons to be displayed; this must be one
of the BTN_XXXX
constantsRET_XXXX
constantsCopyright © 2013 The JGUIraffe Team. All Rights Reserved.