Package snap.viewx
Class DialogBox
java.lang.Object
snap.props.PropObject
snap.view.ViewOwner
snap.viewx.FormBuilder
snap.viewx.DialogBox
- All Implemented Interfaces:
PropChange.DoChange
- Direct Known Subclasses:
DialogSheet
A class to run a dialog box.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
static final int
Return value from class method if NO is chosen.static Image
static Image
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 Image
Return value from class method if CANCEL is chosen.static Image
static final int
Return value form class method if OK is chosen.Fields inherited from class snap.viewx.FormBuilder
_formView
Fields inherited from class snap.view.ViewOwner
Action, DragDrop, DragEnter, DragEvents, DragExit, DragGesture, DragOver, KeyEvents, KeyPress, KeyRelease, KeyType, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Showing_Prop, WinClose
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the Message and Content, if available.protected void
Adds the option buttons for dialog panel.void
cancel()
Cancels the dialog box.void
confirm()
Hides the dialog box.protected View
createUI()
Creates the UI.Returns the button box.Returns the cancel button.Returns the confirm button.Returns the content for dialog box.getImage()
Returns the image.Returns the image.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
hide()
Hide dialog.protected void
initUI()
Initialize the UI.boolean
Returns whether dialog was cancelled.boolean
Returns whether dialog box can be confirmed (confirm button is enabled).boolean
Returns whether to trigger confirm when enter key is pressed.protected void
Called after dialog box shows itself (via runLater).void
RespondUI.void
setConfirmEnabled
(boolean aValue) Sets whether dialog box can be confirmed (confirm button is enabled).void
setConfirmOnEnter
(boolean aValue) Sets whether to trigger confirm when enter key is pressed.void
setContent
(View aView) Sets the content for dialog box.void
setErrorMessage
(String aMessage) Sets the message to display.void
Sets the Image.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
(View aView) Show an option dialog.static boolean
showConfirmDialog
(View aView, String aTitle, String aMessage) Show a dialog panel for confirm message.static void
showErrorDialog
(View aView, String aTitle, String aMessage) Show a dialog panel for error message.static void
showExceptionDialog
(View aView, String aTitle, Throwable e) Show a dialog panel for exception.showInputDialog
(View aView, String aDefault) Shows an input panel.static String
showInputDialog
(View aView, String aTitle, String aMessage, String aDefault) Show a dialog panel for exception.void
showMessageDialog
(View aView) Runs the panel.int
showOptionDialog
(View aView, String aDefault) Show an option dialog.protected boolean
Show Dialog.static void
showWarningDialog
(View aView, String aTitle, String aMessage) Show a dialog panel for warning message.Methods inherited from class snap.viewx.FormBuilder
addButtons, addButtons, addComboBox, addLabel, addRadioButton, addRadioButtons, addSeparator, addTextArea, addTextField, addTextField, addView, createFormView, getFont, getPadding, getSpacing, getStringValue, getValue, removeView, setFont, setPadding, setPadding, setSpacing, setValue, showPanel
Methods inherited from class snap.view.ViewOwner
addKeyActionFilter, addKeyActionHandler, addViewEventHandler, beep, cancelReset, createUIForClass, dispatchEventToOwner, enableEvents, fireActionEventForObject, getEnv, getFirstFocus, getImage, getNative, getToggleGroup, getUI, getUI, getUISource, getView, getView, getViewBoolValue, getViewFloatValue, getViewIntValue, getViewItems, getViewSelIndex, getViewSelItem, getViewStringValue, getViewText, getViewValue, getWindow, initShowing, initWindow, invokeResetUI, invokeRespondUI, isEventThread, isSendEventDisabled, isShowing, isUISet, isViewDisabled, isViewEnabled, isViewVisible, isWindowSet, isWindowVisible, requestFocus, resetLater, resetUI, runDelayed, runLater, setFirstFocus, setSendEventDisabled, setShowing, setViewDisabled, setViewEnabled, setViewItems, setViewItems, setViewSelIndex, setViewSelItem, setViewText, setViewValue, setViewVisible, setWindowVisible
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, clone, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValue, setPropValues, toString, toStringProps
-
Field Details
-
_cancelled
protected boolean _cancelled -
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:
-
questImage
Return value from class method if CANCEL is chosen. -
infoImage
-
warnImage
-
errorImage
-
-
Constructor Details
-
DialogBox
public DialogBox()Constructor. -
DialogBox
Constructor 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. -
getImage
Returns the image. -
setImage
Sets the Image. -
getImageDefault
Returns the image. -
getContent
Returns the content for dialog box. -
setContent
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
Returns the confirm button. -
getCancelButton
Returns the cancel button. -
getButtonBox
Returns the button box. -
showMessageDialog
Runs the panel. -
showConfirmDialog
Show an option dialog. -
showOptionDialog
Show an option dialog. -
showInputDialog
Shows an input panel. -
showPanel
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
Creates the UI.- Overrides:
createUI
in classFormBuilder
-
initUI
protected void initUI()Initialize the UI. -
respondUI
RespondUI.- Overrides:
respondUI
in classFormBuilder
-
showConfirmDialog
Show a dialog panel for confirm message. -
showErrorDialog
Show a dialog panel for error message. -
showWarningDialog
Show a dialog panel for warning message. -
showExceptionDialog
Show a dialog panel for exception. -
showInputDialog
Show a dialog panel for exception.
-