Class DialogBox
- java.lang.Object
- 
- com.inductiveautomation.snap.swing.DialogBox
 
- 
 public class DialogBox extends java.lang.ObjectA class to run a dialog box.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDialogBox.MessageTypestatic classDialogBox.Type
 - 
Field SummaryFields Modifier and Type Field Description static intCANCEL_OPTIONReturn value from class method if NO is chosen.static intNO_OPTIONReturn value form class method if YES is chosen.static intOK_OPTIONstatic java.lang.String[]OPTIONS_OKstatic java.lang.String[]OPTIONS_OK_CANCELstatic java.lang.String[]OPTIONS_YES_NO_CANCELstatic intYES_OPTIONReturn value form class method if OK is chosen.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()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.javax.swing.JComponentgetContent()Returns the content for dialog box.javax.swing.IcongetIcon()Returns the icon.java.lang.StringgetMessage()Returns the message to display.DialogBox.MessageTypegetMessageType()Returns the message type of the box.java.lang.String[]getOptions()Returns the options strings.java.lang.StringgetTitle()Returns the title of the dialog box.DialogBox.TypegetType()Returns the type of the box.protected voidinitDialogPanel()Registers EnterAction for dialog.voidsetContent(javax.swing.JComponent aComp)Sets the content for dialog box.voidsetErrorMessage(java.lang.String aMessage)Sets the message to display.voidsetIcon(javax.swing.Icon anIcon)Sets the icon.voidsetMessage(java.lang.String aMessage)Sets the message to display.voidsetMessageType(DialogBox.MessageType aMessageType)Sets the message type of the box.voidsetOptions(java.lang.String... theOptions)Sets the option strings.voidsetQuestionMessage(java.lang.String aMessage)Sets the message to display.voidsetTitle(java.lang.String aTitle)Sets the title of the dialog box.voidsetType(DialogBox.Type aType)Sets the type of the box.voidsetWarningMessage(java.lang.String aMessage)Sets the message to display.booleanshowConfirmDialog(javax.swing.JComponent aComp)Shows an option dialog.java.lang.StringshowInputDialog(javax.swing.JComponent aComp, java.lang.String aDefault)Shows an input panel.voidshowMessageDialog(javax.swing.JComponent aComp)Runs the panel.intshowOptionDialog(javax.swing.JComponent aComp, java.lang.String aDefault)Shows an option panel.
 
- 
- 
- 
Field Detail- 
OPTIONS_OKpublic static final java.lang.String[] OPTIONS_OK 
 - 
OPTIONS_OK_CANCELpublic static final java.lang.String[] OPTIONS_OK_CANCEL 
 - 
OPTIONS_YES_NO_CANCELpublic static final java.lang.String[] OPTIONS_YES_NO_CANCEL 
 - 
OK_OPTIONpublic static final int OK_OPTION - See Also:
- Constant Field Values
 
 - 
YES_OPTIONpublic static final int YES_OPTION Return value form class method if OK is chosen.- See Also:
- Constant Field Values
 
 - 
NO_OPTIONpublic static final int NO_OPTION Return value form class method if YES is chosen.- See Also:
- Constant Field Values
 
 - 
CANCEL_OPTIONpublic static final int CANCEL_OPTION Return value from class method if NO is chosen.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getMessagepublic java.lang.String getMessage() Returns the message to display.
 - 
setMessagepublic void setMessage(java.lang.String aMessage) Sets the message to display.
 - 
setErrorMessagepublic void setErrorMessage(java.lang.String aMessage) Sets the message to display.
 - 
setWarningMessagepublic void setWarningMessage(java.lang.String aMessage) Sets the message to display.
 - 
setQuestionMessagepublic void setQuestionMessage(java.lang.String aMessage) Sets the message to display.
 - 
getTitlepublic java.lang.String getTitle() Returns the title of the dialog box.
 - 
setTitlepublic void setTitle(java.lang.String aTitle) Sets the title of the dialog box.
 - 
getTypepublic DialogBox.Type getType() Returns the type of the box.
 - 
setTypepublic void setType(DialogBox.Type aType) Sets the type of the box.
 - 
getMessageTypepublic DialogBox.MessageType getMessageType() Returns the message type of the box.
 - 
setMessageTypepublic void setMessageType(DialogBox.MessageType aMessageType) Sets the message type of the box.
 - 
getOptionspublic java.lang.String[] getOptions() Returns the options strings.
 - 
setOptionspublic void setOptions(java.lang.String... theOptions) Sets the option strings.
 - 
getContentpublic javax.swing.JComponent getContent() Returns the content for dialog box.
 - 
setContentpublic void setContent(javax.swing.JComponent aComp) Sets the content for dialog box.
 - 
getIconpublic javax.swing.Icon getIcon() Returns the icon.
 - 
setIconpublic void setIcon(javax.swing.Icon anIcon) Sets the icon.
 - 
showMessageDialogpublic void showMessageDialog(javax.swing.JComponent aComp) Runs the panel.
 - 
showConfirmDialogpublic boolean showConfirmDialog(javax.swing.JComponent aComp) Shows an option dialog.
 - 
showOptionDialogpublic int showOptionDialog(javax.swing.JComponent aComp, java.lang.String aDefault)Shows an option panel.
 - 
showInputDialogpublic java.lang.String showInputDialog(javax.swing.JComponent aComp, java.lang.String aDefault)Shows 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.
 
- 
 
-