public class DialogSet extends Object implements PropertyChangeListener
Dialog
objects to be
instantiated.
A placement policy may be assigned to a DialogSet
; this
policy defines where dialogs will appear relative to their owner
Window
. If there is no owner, dialogs will appear in the
center of the screen.
Although each instance of DialogSet
may have its own owner
Window
and placement policy, they will all share singleton
instances of KMessageDialog
, KQuestionDialog
, and
KInputDialog
.
KMessageDialog
,
KQuestionDialog
,
KInputDialog
Modifier and Type | Field and Description |
---|---|
private Window |
_owner |
static int |
CASCADE_PLACEMENT
Placement policy.
|
static int |
CENTER_PLACEMENT
Placement policy.
|
private static KInputDialog |
d_input |
private static KMessageDialog |
d_message |
private static KQuestionDialog |
d_question |
private static DialogSet |
defaultSet |
private int |
placement |
private String |
s_input |
private String |
s_message |
private String |
s_question |
private static PropertyChangeSupport |
support |
Modifier | Constructor and Description |
---|---|
private |
DialogSet() |
|
DialogSet(Window owner,
int placement)
Construct a new
DialogSet with the given owner and
placement policy. |
Modifier and Type | Method and Description |
---|---|
private void |
_positionDialog(Window owner,
Dialog dialog) |
private String |
_showInputDialog(Window owner,
String title,
Icon icon,
String prompt,
String defaultValue) |
private void |
_showMessageDialog(Window owner,
String title,
Icon icon,
String message) |
private boolean |
_showQuestionDialog(Window parent,
String title,
Icon icon,
String prompt,
int type) |
static DialogSet |
getInstance()
Get a reference to the default instance of
DialogSet . |
void |
propertyChange(PropertyChangeEvent evt)
Respond to property change events.
|
void |
setOwner(Window owner)
Set the owner window for this
DialogSet . |
String |
showInputDialog(String prompt)
Show a
KInputDialog . |
String |
showInputDialog(String title,
Icon icon,
String prompt)
Show a
KInputDialog . |
String |
showInputDialog(String title,
Icon icon,
String prompt,
String defaultValue)
Show a
KInputDialog . |
String |
showInputDialog(String prompt,
String defaultValue)
Show a
KInputDialog . |
String |
showInputDialog(Window parent,
String prompt)
Show a
KInputDialog . |
String |
showInputDialog(Window parent,
String title,
Icon icon,
String prompt,
String defaultValue)
Show a
KInputDialog . |
void |
showMessageDialog(String message)
Show a
KMessageDialog . |
void |
showMessageDialog(String title,
Icon icon,
String message)
Show a
KMessageDialog . |
void |
showMessageDialog(Window parent,
String message)
Show a
KMessageDialog . |
void |
showMessageDialog(Window parent,
String title,
Icon icon,
String message)
Show a
KMessageDialog . |
boolean |
showQuestionDialog(String prompt)
Show a
KQuestionDialog . |
boolean |
showQuestionDialog(String title,
Icon icon,
String prompt)
Show a
KQuestionDialog . |
boolean |
showQuestionDialog(String title,
Icon icon,
String prompt,
int type)
Show a
KQuestionDialog . |
boolean |
showQuestionDialog(String prompt,
int type)
Show a
KQuestionDialog . |
boolean |
showQuestionDialog(Window parent,
String prompt)
Show a
KQuestionDialog . |
boolean |
showQuestionDialog(Window parent,
String title,
Icon icon,
String prompt,
int type)
Show a
KQuestionDialog . |
boolean |
showQuestionDialog(Window parent,
String prompt,
int type)
Show a
KQuestionDialog . |
private static KInputDialog d_input
private static KMessageDialog d_message
private static KQuestionDialog d_question
private static PropertyChangeSupport support
private String s_question
public static final int CENTER_PLACEMENT
Window
.public static final int CASCADE_PLACEMENT
Window
.private int placement
private static DialogSet defaultSet
private DialogSet()
public DialogSet(Window owner, int placement) throws IllegalArgumentException
DialogSet
with the given owner and
placement policy.owner
- The Window
that is the owner of this
DialogSet
.placement
- The placement for dialogs in this
DialogSet
; one of the numeric constants defined above.IllegalArgumentException
public static DialogSet getInstance()
DialogSet
. This
instance has no owner Window
, and hence its dialogs appear
centered on the screen.public void setOwner(Window owner)
DialogSet
.owner
- The new owner window.public String showInputDialog(String prompt)
KInputDialog
. Displays an input dialog and returns
when the dialog is dismissed.prompt
- The prompt to display in the dialog.null
if the dialog was cancelled.public String showInputDialog(Window parent, String prompt)
KInputDialog
. Displays an input dialog and returns
when the dialog is dismissed.parent
- The parent window.prompt
- The prompt to display in the dialog.null
if the dialog was cancelled.public String showInputDialog(String prompt, String defaultValue)
KInputDialog
. Displays an input dialog and returns
when the dialog is dismissed.prompt
- The prompt to display in the dialog.defaultValue
- The default value to display in the input field.null
if the dialog was cancelled.public String showInputDialog(String title, Icon icon, String prompt)
KInputDialog
. Displays an input dialog and returns
when the dialog is dismissed.title
- The title for the dialog window.icon
- The icon to display in the dialog.prompt
- The prompt to display in the dialog.null
if the dialog was cancelled.public String showInputDialog(String title, Icon icon, String prompt, String defaultValue)
KInputDialog
. Displays an input dialog and returns
when the dialog is dismissed.title
- The title for the dialog window.icon
- The icon to display in the dialog.prompt
- The prompt to display in the dialog.defaultValue
- The default value to display in the input field.null
if the dialog was cancelled.public String showInputDialog(Window parent, String title, Icon icon, String prompt, String defaultValue)
KInputDialog
. Displays an input dialog and returns
when the dialog is dismissed.parent
- The parent window.title
- The title for the dialog window.icon
- The icon to display in the dialog.prompt
- The prompt to display in the dialog.defaultValue
- The default value to display in the input field.null
if the dialog was cancelled.private String _showInputDialog(Window owner, String title, Icon icon, String prompt, String defaultValue)
public boolean showQuestionDialog(String prompt, int type)
KQuestionDialog
. Displays a question dialog and
returns when the dialog is dismissed.prompt
- The prompt to display in the dialog.type
- The question dialog type to display; one of the symbolic
constants defined in KQuestionDialog
.true
if the dialog was
accepted or false
if it was cancelled.public boolean showQuestionDialog(String prompt)
KQuestionDialog
. Displays a question dialog and
returns when the dialog is dismissed.prompt
- The prompt to display in the dialog.true
if the dialog was
accepted or false
if it was cancelled.public boolean showQuestionDialog(Window parent, String prompt)
KQuestionDialog
. Displays a question dialog and
returns when the dialog is dismissed.parent
- The parent window.prompt
- The prompt to display in the dialog.true
if the dialog was
accepted or false
if it was cancelled.public boolean showQuestionDialog(Window parent, String prompt, int type)
KQuestionDialog
. Displays a question dialog and
returns when the dialog is dismissed.parent
- The parent window.prompt
- The prompt to display in the dialog.type
- The question dialog type to display; one of the symbolic
constants defined in KQuestionDialog
.true
if the dialog was
accepted or false
if it was cancelled.public boolean showQuestionDialog(String title, Icon icon, String prompt)
KQuestionDialog
. Displays a question dialog and
returns when the dialog is dismissed.title
- The title for the dialog window.icon
- The icon to display in the dialog.prompt
- The promopt to display in the dialog.true
if the dialog was
accepted or false
if it was cancelled.public boolean showQuestionDialog(String title, Icon icon, String prompt, int type)
KQuestionDialog
. Displays a question dialog and
returns when the dialog is dismissed.title
- The title for the dialog window.icon
- The icon to display in the dialog.prompt
- The promopt to display in the dialog.type
- The question dialog type to display; one of the symbolic
constants defined in KQuestionDialog
.true
if the dialog was
accepted or false
if it was cancelled.public boolean showQuestionDialog(Window parent, String title, Icon icon, String prompt, int type)
KQuestionDialog
. Displays a question dialog and
returns when the dialog is dismissed.parent
- The parent window.title
- The title for the dialog window.icon
- The icon to display in the dialog.prompt
- The promopt to display in the dialog.type
- The question dialog type to display; one of the symbolic
constants defined in KQuestionDialog
.true
if the dialog was
accepted or false
if it was cancelled.private boolean _showQuestionDialog(Window parent, String title, Icon icon, String prompt, int type)
public void showMessageDialog(Window parent, String message)
KMessageDialog
. Displays a message dialog and returns
when the dialog is dismissed.parent
- The parent window.message
- The prompt to display in the dialog.public void showMessageDialog(String message)
KMessageDialog
. Displays a message dialog and returns
when the dialog is dismissed.message
- The prompt to display in the dialog.public void showMessageDialog(String title, Icon icon, String message)
KMessageDialog
. Displays a message dialog and returns
when the dialog is dismissed.title
- The title for the dialog window.icon
- The icon to display in the dialog.message
- The prompt to display in the dialog.public void showMessageDialog(Window parent, String title, Icon icon, String message)
KMessageDialog
. Displays a message dialog and returns
when the dialog is dismissed.parent
- The parent window.title
- The title for the dialog window.icon
- The icon to display in the dialog.message
- The prompt to display in the dialog.private void _showMessageDialog(Window owner, String title, Icon icon, String message)
private void _positionDialog(Window owner, Dialog dialog)
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses