Class DialogBox
java.lang.Object
com.inductiveautomation.snap.swing.DialogBox
A class to run a dialog box.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Return value from class method if NO is chosen.static final int
Return value form class method if YES is chosen.static final int
static final String[]
static final String[]
static final String[]
static final int
Return value form class method if OK is chosen. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Returns the content for dialog box.getIcon()
Returns the icon.Returns the message to display.Returns the message type of the box.String[]
Returns the options strings.getTitle()
Returns the title of the dialog box.getType()
Returns the type of the box.protected void
Registers EnterAction for dialog.void
setContent
(JComponent aComp) Sets the content for dialog box.void
setErrorMessage
(String aMessage) Sets the message to display.void
Sets the icon.void
setMessage
(String aMessage) Sets the message to display.void
setMessageType
(DialogBox.MessageType aMessageType) Sets the message type of the box.void
setOptions
(String... theOptions) Sets the option strings.void
setQuestionMessage
(String aMessage) Sets the message to display.void
Sets the title of the dialog box.void
setType
(DialogBox.Type aType) Sets the type of the box.void
setWarningMessage
(String aMessage) Sets the message to display.boolean
showConfirmDialog
(JComponent aComp) Shows an option dialog.showInputDialog
(JComponent aComp, String aDefault) Shows an input panel.void
showMessageDialog
(JComponent aComp) Runs the panel.int
showOptionDialog
(JComponent aComp, String aDefault) Shows an option panel.
-
Field Details
-
OPTIONS_OK
-
OPTIONS_OK_CANCEL
-
OPTIONS_YES_NO_CANCEL
-
OK_OPTION
public static final int OK_OPTION- See Also:
-
YES_OPTION
public static final int YES_OPTIONReturn value form class method if OK is chosen.- See Also:
-
NO_OPTION
public static final int NO_OPTIONReturn value form class method if YES is chosen.- See Also:
-
CANCEL_OPTION
public static final int CANCEL_OPTIONReturn value from class method if NO is chosen.- See Also:
-
-
Constructor Details
-
DialogBox
public DialogBox()Creates a new SwingDialogBox. -
DialogBox
Creates a new SwingDialogBox with given title.
-
-
Method Details
-
getMessage
Returns the message to display. -
setMessage
Sets the message to display. -
setErrorMessage
Sets the message to display. -
setWarningMessage
Sets the message to display. -
setQuestionMessage
Sets the message to display. -
getTitle
Returns the title of the dialog box. -
setTitle
Sets the title of the dialog box. -
getType
Returns the type of the box. -
setType
Sets the type of the box. -
getMessageType
Returns the message type of the box. -
setMessageType
Sets the message type of the box. -
getOptions
Returns the options strings. -
setOptions
Sets the option strings. -
getContent
Returns the content for dialog box. -
setContent
Sets the content for dialog box. -
getIcon
Returns the icon. -
setIcon
Sets the icon. -
showMessageDialog
Runs the panel. -
showConfirmDialog
Shows an option dialog. -
showOptionDialog
Shows an option panel. -
showInputDialog
Shows an input panel. -
confirm
public void confirm()Closes the running dialog panel, with option to click the okay button. -
cancel
public void cancel()Closes the running dialog panel, with option to click the okay button. -
initDialogPanel
protected void initDialogPanel()Registers EnterAction for dialog.
-