Class DialogBox
java.lang.Object
com.inductiveautomation.snap.swing.DialogBox
A class to run a dialog box.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intReturn value from class method if NO is chosen.static final intReturn value form class method if YES is chosen.static final intstatic final String[]static final String[]static final String[]static final intReturn value form class method if OK is chosen.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcancel()Closes the running dialog panel, with option to click the okay button.voidconfirm()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 voidRegisters EnterAction for dialog.voidsetContent(JComponent aComp) Sets the content for dialog box.voidsetErrorMessage(String aMessage) Sets the message to display.voidSets the icon.voidsetMessage(String aMessage) Sets the message to display.voidsetMessageType(DialogBox.MessageType aMessageType) Sets the message type of the box.voidsetOptions(String... theOptions) Sets the option strings.voidsetQuestionMessage(String aMessage) Sets the message to display.voidSets the title of the dialog box.voidsetType(DialogBox.Type aType) Sets the type of the box.voidsetWarningMessage(String aMessage) Sets the message to display.booleanshowConfirmDialog(JComponent aComp) Shows an option dialog.showInputDialog(JComponent aComp, String aDefault) Shows an input panel.voidshowMessageDialog(JComponent aComp) Runs the panel.intshowOptionDialog(JComponent aComp, String aDefault) Shows an option panel.
- 
Field Details- 
OPTIONS_OK
- 
OPTIONS_OK_CANCEL
- 
OPTIONS_YES_NO_CANCEL
- 
OK_OPTIONpublic static final int OK_OPTION- See Also:
 
- 
YES_OPTIONpublic static final int YES_OPTIONReturn value form class method if OK is chosen.- See Also:
 
- 
NO_OPTIONpublic static final int NO_OPTIONReturn value form class method if YES is chosen.- See Also:
 
- 
CANCEL_OPTIONpublic static final int CANCEL_OPTIONReturn value from class method if NO is chosen.- See Also:
 
 
- 
- 
Constructor Details- 
DialogBoxpublic DialogBox()Creates a new SwingDialogBox.
- 
DialogBoxCreates a new SwingDialogBox with given title.
 
- 
- 
Method Details- 
getMessageReturns the message to display.
- 
setMessageSets the message to display.
- 
setErrorMessageSets the message to display.
- 
setWarningMessageSets the message to display.
- 
setQuestionMessageSets the message to display.
- 
getTitleReturns the title of the dialog box.
- 
setTitleSets the title of the dialog box.
- 
getTypeReturns the type of the box.
- 
setTypeSets the type of the box.
- 
getMessageTypeReturns the message type of the box.
- 
setMessageTypeSets the message type of the box.
- 
getOptionsReturns the options strings.
- 
setOptionsSets the option strings.
- 
getContentReturns the content for dialog box.
- 
setContentSets the content for dialog box.
- 
getIconReturns the icon.
- 
setIconSets the icon.
- 
showMessageDialogRuns the panel.
- 
showConfirmDialogShows an option dialog.
- 
showOptionDialogShows an option panel.
- 
showInputDialogShows an input panel.
- 
confirmpublic void confirm()Closes the running dialog panel, with option to click the okay button.
- 
cancelpublic void cancel()Closes the running dialog panel, with option to click the okay button.
- 
initDialogPanelprotected void initDialogPanel()Registers EnterAction for dialog.
 
-