Class DialogBox

java.lang.Object
com.inductiveautomation.snap.swing.DialogBox

public class DialogBox extends Object
A class to run a dialog box.
  • Field Details

    • OPTIONS_OK

      public static final String[] OPTIONS_OK
    • OPTIONS_OK_CANCEL

      public static final String[] OPTIONS_OK_CANCEL
    • OPTIONS_YES_NO_CANCEL

      public static final String[] OPTIONS_YES_NO_CANCEL
    • OK_OPTION

      public static final int OK_OPTION
      See Also:
    • YES_OPTION

      public static final int YES_OPTION
      Return value form class method if OK is chosen.
      See Also:
    • NO_OPTION

      public static final int NO_OPTION
      Return value form class method if YES is chosen.
      See Also:
    • CANCEL_OPTION

      public static final int CANCEL_OPTION
      Return value from class method if NO is chosen.
      See Also:
  • Constructor Details

    • DialogBox

      public DialogBox()
      Creates a new SwingDialogBox.
    • DialogBox

      public DialogBox(String aTitle)
      Creates a new SwingDialogBox with given title.
  • Method Details

    • getMessage

      public String getMessage()
      Returns the message to display.
    • setMessage

      public void setMessage(String aMessage)
      Sets the message to display.
    • setErrorMessage

      public void setErrorMessage(String aMessage)
      Sets the message to display.
    • setWarningMessage

      public void setWarningMessage(String aMessage)
      Sets the message to display.
    • setQuestionMessage

      public void setQuestionMessage(String aMessage)
      Sets the message to display.
    • getTitle

      public String getTitle()
      Returns the title of the dialog box.
    • setTitle

      public void setTitle(String aTitle)
      Sets the title of the dialog box.
    • getType

      public DialogBox.Type getType()
      Returns the type of the box.
    • setType

      public void setType(DialogBox.Type aType)
      Sets the type of the box.
    • getMessageType

      public DialogBox.MessageType getMessageType()
      Returns the message type of the box.
    • setMessageType

      public void setMessageType(DialogBox.MessageType aMessageType)
      Sets the message type of the box.
    • getOptions

      public String[] getOptions()
      Returns the options strings.
    • setOptions

      public void setOptions(String... theOptions)
      Sets the option strings.
    • getContent

      public JComponent getContent()
      Returns the content for dialog box.
    • setContent

      public void setContent(JComponent aComp)
      Sets the content for dialog box.
    • getIcon

      public Icon getIcon()
      Returns the icon.
    • setIcon

      public void setIcon(Icon anIcon)
      Sets the icon.
    • showMessageDialog

      public void showMessageDialog(JComponent aComp)
      Runs the panel.
    • showConfirmDialog

      public boolean showConfirmDialog(JComponent aComp)
      Shows an option dialog.
    • showOptionDialog

      public int showOptionDialog(JComponent aComp, String aDefault)
      Shows an option panel.
    • showInputDialog

      public String showInputDialog(JComponent aComp, String aDefault)
      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.