Package snap.viewx

Class DialogBox

All Implemented Interfaces:
PropChange.DoChange
Direct Known Subclasses:
DialogSheet

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

    • _cancelled

      protected boolean _cancelled
    • 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:
    • questImage

      public static Image questImage
      Return value from class method if CANCEL is chosen.
    • infoImage

      public static Image infoImage
    • warnImage

      public static Image warnImage
    • errorImage

      public static Image errorImage
  • Constructor Details

    • DialogBox

      public DialogBox()
      Constructor.
    • DialogBox

      public DialogBox(String aTitle)
      Constructor 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.
    • getImage

      public Image getImage()
      Returns the image.
    • setImage

      public void setImage(Image anImage)
      Sets the Image.
    • getImageDefault

      public Image getImageDefault()
      Returns the image.
    • getContent

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

      public void setContent(View aView)
      Sets the content for dialog box.
    • isConfirmEnabled

      public boolean isConfirmEnabled()
      Returns whether dialog box can be confirmed (confirm button is enabled).
    • setConfirmEnabled

      public void setConfirmEnabled(boolean aValue)
      Sets whether dialog box can be confirmed (confirm button is enabled).
    • isConfirmOnEnter

      public boolean isConfirmOnEnter()
      Returns whether to trigger confirm when enter key is pressed.
    • setConfirmOnEnter

      public void setConfirmOnEnter(boolean aValue)
      Sets whether to trigger confirm when enter key is pressed.
    • getConfirmButton

      public Button getConfirmButton()
      Returns the confirm button.
    • getCancelButton

      public Button getCancelButton()
      Returns the cancel button.
    • getButtonBox

      public RowView getButtonBox()
      Returns the button box.
    • showMessageDialog

      public void showMessageDialog(View aView)
      Runs the panel.
    • showConfirmDialog

      public boolean showConfirmDialog(View aView)
      Show an option dialog.
    • showOptionDialog

      public int showOptionDialog(View aView, String aDefault)
      Show an option dialog.
    • showInputDialog

      public String showInputDialog(View aView, String aDefault)
      Shows an input panel.
    • showPanel

      protected boolean showPanel(View aView)
      Show Dialog.
    • hide

      protected void hide()
      Hide dialog.
    • confirm

      public void confirm()
      Hides the dialog box.
    • cancel

      public void cancel()
      Cancels the dialog box.
    • isCancelled

      public boolean isCancelled()
      Returns whether dialog was cancelled.
    • addMessageAndContent

      protected void addMessageAndContent()
      Adds the Message and Content, if available.
    • addOptionButtons

      protected void addOptionButtons()
      Adds the option buttons for dialog panel.
    • notifyDidShow

      protected void notifyDidShow()
      Called after dialog box shows itself (via runLater).
    • createUI

      protected View createUI()
      Creates the UI.
      Overrides:
      createUI in class FormBuilder
    • initUI

      protected void initUI()
      Initialize the UI.
      Overrides:
      initUI in class ViewOwner
    • respondUI

      public void respondUI(ViewEvent anEvent)
      RespondUI.
      Overrides:
      respondUI in class FormBuilder
    • showConfirmDialog

      public static boolean showConfirmDialog(View aView, String aTitle, String aMessage)
      Show a dialog panel for confirm message.
    • showErrorDialog

      public static void showErrorDialog(View aView, String aTitle, String aMessage)
      Show a dialog panel for error message.
    • showWarningDialog

      public static void showWarningDialog(View aView, String aTitle, String aMessage)
      Show a dialog panel for warning message.
    • showExceptionDialog

      public static void showExceptionDialog(View aView, String aTitle, Throwable e)
      Show a dialog panel for exception.
    • showInputDialog

      public static String showInputDialog(View aView, String aTitle, String aMessage, String aDefault)
      Show a dialog panel for exception.