public class DialogBox
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DialogBox.MessageType |
static class |
DialogBox.Type |
Modifier and Type | Field and Description |
---|---|
static int |
CANCEL_OPTION
Return value from class method if NO is chosen.
|
static int |
NO_OPTION
Return value form class method if YES is chosen.
|
static int |
OK_OPTION |
static java.lang.String[] |
OPTIONS_OK |
static java.lang.String[] |
OPTIONS_OK_CANCEL |
static java.lang.String[] |
OPTIONS_YES_NO_CANCEL |
static int |
YES_OPTION
Return value form class method if OK is chosen.
|
Constructor and Description |
---|
DialogBox()
Creates a new SwingDialogBox.
|
DialogBox(java.lang.String aTitle)
Creates a new SwingDialogBox with given title.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Closes the running dialog panel, with option to click the okay button.
|
void |
confirm()
Closes the running dialog panel, with option to click the okay button.
|
javax.swing.JComponent |
getContent()
Returns the content for dialog box.
|
javax.swing.Icon |
getIcon()
Returns the icon.
|
java.lang.String |
getMessage()
Returns the message to display.
|
DialogBox.MessageType |
getMessageType()
Returns the message type of the box.
|
java.lang.String[] |
getOptions()
Returns the options strings.
|
java.lang.String |
getTitle()
Returns the title of the dialog box.
|
DialogBox.Type |
getType()
Returns the type of the box.
|
protected void |
initDialogPanel()
Registers EnterAction for dialog.
|
void |
setContent(javax.swing.JComponent aComp)
Sets the content for dialog box.
|
void |
setErrorMessage(java.lang.String aMessage)
Sets the message to display.
|
void |
setIcon(javax.swing.Icon anIcon)
Sets the icon.
|
void |
setMessage(java.lang.String aMessage)
Sets the message to display.
|
void |
setMessageType(DialogBox.MessageType aMessageType)
Sets the message type of the box.
|
void |
setOptions(java.lang.String... theOptions)
Sets the option strings.
|
void |
setQuestionMessage(java.lang.String aMessage)
Sets the message to display.
|
void |
setTitle(java.lang.String aTitle)
Sets the title of the dialog box.
|
void |
setType(DialogBox.Type aType)
Sets the type of the box.
|
void |
setWarningMessage(java.lang.String aMessage)
Sets the message to display.
|
boolean |
showConfirmDialog(javax.swing.JComponent aComp)
Shows an option dialog.
|
java.lang.String |
showInputDialog(javax.swing.JComponent aComp,
java.lang.String aDefault)
Shows an input panel.
|
void |
showMessageDialog(javax.swing.JComponent aComp)
Runs the panel.
|
int |
showOptionDialog(javax.swing.JComponent aComp,
java.lang.String aDefault)
Shows an option panel.
|
public static final java.lang.String[] OPTIONS_OK
public static final java.lang.String[] OPTIONS_OK_CANCEL
public static final java.lang.String[] OPTIONS_YES_NO_CANCEL
public static final int OK_OPTION
public static final int YES_OPTION
public static final int NO_OPTION
public static final int CANCEL_OPTION
public DialogBox()
public DialogBox(java.lang.String aTitle)
public java.lang.String getMessage()
public void setMessage(java.lang.String aMessage)
public void setErrorMessage(java.lang.String aMessage)
public void setWarningMessage(java.lang.String aMessage)
public void setQuestionMessage(java.lang.String aMessage)
public java.lang.String getTitle()
public void setTitle(java.lang.String aTitle)
public DialogBox.Type getType()
public void setType(DialogBox.Type aType)
public DialogBox.MessageType getMessageType()
public void setMessageType(DialogBox.MessageType aMessageType)
public java.lang.String[] getOptions()
public void setOptions(java.lang.String... theOptions)
public javax.swing.JComponent getContent()
public void setContent(javax.swing.JComponent aComp)
public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon anIcon)
public void showMessageDialog(javax.swing.JComponent aComp)
public boolean showConfirmDialog(javax.swing.JComponent aComp)
public int showOptionDialog(javax.swing.JComponent aComp, java.lang.String aDefault)
public java.lang.String showInputDialog(javax.swing.JComponent aComp, java.lang.String aDefault)
public void confirm()
public void cancel()
protected void initDialogPanel()