Class DialogPane
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
javafx.scene.layout.StackPane
com.dlsc.gemsfx.DialogPane
- All Implemented Interfaces:
javafx.css.Styleable, javafx.event.EventTarget
public class DialogPane
extends javafx.scene.layout.StackPane
A pane that allows applications to display a lightweight dialog right inside the application
window instead of a separate window. The dialogs are animated and fly-in from top to center and
fly-out from center to top.
The dialog pane should be added to the application in such a way that it covers the entire area of the window. If the application is using a StackPane as its root container then the dialog pane can simply be added as the last child of the StackPane.
Example
To show an information dialog one can simply call:
dialogPane.showInformation("My Title", "My message");
If an application wants to act upon the button that was pressed after showing a confirmation dialog then the following can be written:
dialogPane.showConfirmation("Confirm", "Really delete?").onClose(buttonType -> { ... });
The pane supports factories for creating the header and the footer. This allows application developers
to completely replace those elements of the dialogs. Default factories are already registered and will
be used if not replaced.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe default resize handler is used to persist the dialog's width and height after the user performed a resize operation on the dialog.static classRepresents a dialog that can be displayed to the user.static classThe default footer / button bar implementation for dialogs managed by theDialogPane.static classThe default header implementation for dialogs managed by theDialogPane.static enumThe various dialog types supported byDialogPane. -
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.BooleanPropertyDetermines if the dialogs will be animated when they appear.final javafx.beans.property.ObjectProperty<javafx.util.Duration> Stores the duration used to animate the fly-in / fly-out of the dialogs.final javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javafx.scene.control.ButtonType>> A string converter can be applied to easily manipulate the default text representation of the various button types.final javafx.beans.property.ListProperty<DialogPane.Dialog<?>> Stores the list of currently active dialogs.final javafx.beans.property.BooleanPropertyControls whether the glass pane and the dialogs will animate their opacity during showing or hiding dialogs.final javafx.beans.property.ObjectProperty<javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node>> A callback used as a factory for creating the footer for each dialog.final javafx.beans.property.ObjectProperty<javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node>> A callback used as a factory for creating the header for each dialog.final javafx.beans.property.ObjectProperty<Supplier<javafx.scene.control.Label>> A supplier used for creating the label instances that will be used by the standard dialogs.final javafx.beans.property.DoublePropertyDefines the padding around a maximized dialog in the dialog pane.final javafx.beans.property.StringPropertyfinal javafx.beans.property.ReadOnlyBooleanPropertyA read-only property used to signal that the pane is currently showing a dialog or not.Properties inherited from class javafx.scene.layout.StackPane
alignmentProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.beans.property.BooleanPropertyDetermines if the dialogs will be animated when they appear.final javafx.beans.property.ObjectProperty<javafx.util.Duration> Stores the duration used to animate the fly-in / fly-out of the dialogs.final javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javafx.scene.control.ButtonType>> A string converter can be applied to easily manipulate the default text representation of the various button types.final javafx.beans.property.ListProperty<DialogPane.Dialog<?>> Stores the list of currently active dialogs.final javafx.beans.property.BooleanPropertyControls whether the glass pane and the dialogs will animate their opacity during showing or hiding dialogs.final javafx.beans.property.ObjectProperty<javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node>> A callback used as a factory for creating the footer for each dialog.final javafx.util.DurationGets the value of theanimationDurationproperty.final javafx.util.StringConverter<javafx.scene.control.ButtonType> Gets the value of theconverterproperty.final javafx.collections.ObservableList<DialogPane.Dialog<?>> The list of currently active / showing dialogs.final javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node> Gets the value of thefooterFactoryproperty.final GlassPaneRetrieves the glass pane associated with this dialog pane.final javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node> Gets the value of theheaderFactoryproperty.final Supplier<javafx.scene.control.Label> Gets the value of thelabelSupplierproperty.final doubleGets the value of themaximizedPaddingproperty.final StringGets the value of thesendButtonTextproperty.final javafx.beans.property.ObjectProperty<javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node>> A callback used as a factory for creating the header for each dialog.voidHides all currently active dialogs.voidhideDialog(DialogPane.Dialog<?> dialog) Hides the given dialog.final booleanGets the value of theanimateDialogsproperty.final booleanGets the value of thefadeInOutproperty.final booleanGets the value of theshowingDialogproperty.final javafx.beans.property.ObjectProperty<Supplier<javafx.scene.control.Label>> A supplier used for creating the label instances that will be used by the standard dialogs.protected voidfinal javafx.beans.property.DoublePropertyDefines the padding around a maximized dialog in the dialog pane.final javafx.beans.property.StringPropertyfinal voidsetAnimateDialogs(boolean animate) Sets the value of theanimateDialogsproperty.final voidsetAnimationDuration(javafx.util.Duration animationDuration) Sets the value of theanimationDurationproperty.final voidsetConverter(javafx.util.StringConverter<javafx.scene.control.ButtonType> converter) Sets the value of theconverterproperty.final voidsetDialogs(javafx.collections.ObservableList<DialogPane.Dialog<?>> dialogs) Sets the value of thedialogsproperty.final voidsetFadeInOut(boolean animate) Sets the value of thefadeInOutproperty.final voidsetFooterFactory(javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node> footerFactory) Sets the value of thefooterFactoryproperty.final voidsetHeaderFactory(javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node> headerFactory) Sets the value of theheaderFactoryproperty.final voidsetLabelSupplier(Supplier<javafx.scene.control.Label> labelSupplier) Sets the value of thelabelSupplierproperty.final voidsetMaximizedPadding(double maximizedPadding) Sets the value of themaximizedPaddingproperty.final voidsetSendButtonText(String sendButtonText) Sets the value of thesendButtonTextproperty.final DialogPane.Dialog<Void> Creates and shows a dialog that shows a busy indicator / busy animation.final DialogPane.Dialog<javafx.scene.control.ButtonType> showConfirmation(String title, String message) Creates and shows a confirmation dialog.final DialogPane.Dialog<javafx.scene.control.ButtonType> showConfirmation(String title, String message, List<javafx.scene.control.ButtonType> buttonTypes) Creates and shows a confirmation dialog.voidshowDialog(DialogPane.Dialog<?> dialog) Makes the given dialog visible in the pane.final DialogPane.Dialog<Void> Creates and shows an error message dialog.final DialogPane.Dialog<Void> Creates and shows an error message dialog.final DialogPane.Dialog<Void> Creates and shows an error message dialog.final DialogPane.Dialog<Void> Creates and shows an error message dialog.final DialogPane.Dialog<Void> Creates and shows an error message dialog.final DialogPane.Dialog<javafx.scene.control.ButtonType> showInformation(String title, String message) Creates and shows an information dialog.final DialogPane.Dialog<javafx.scene.control.ButtonType> showInformation(String title, String message, List<javafx.scene.control.ButtonType> buttons) Creates and shows an information dialog.final javafx.beans.property.ReadOnlyBooleanPropertyA read-only property used to signal that the pane is currently showing a dialog or not.final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node) Shows an arbitrary node in a dialog.final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize) Shows an arbitrary node in a dialog.final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize, List<javafx.scene.control.ButtonType> buttons) Shows an arbitrary node in a dialog.final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize, List<javafx.scene.control.ButtonType> buttons, boolean sameWidthButtons) Shows an arbitrary node in a dialog.final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize, List<javafx.scene.control.ButtonType> buttons, boolean sameWidthButtons, javafx.beans.property.BooleanProperty validProperty) Shows an arbitrary node in a dialog.final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, List<javafx.scene.control.ButtonType> buttons) Shows an arbitrary node in a dialog.final DialogPane.Dialog<String> showTextInput(String title, String text) Creates and shows a text input dialog.final DialogPane.Dialog<String> showTextInput(String title, String text, boolean multiline) Creates and shows a text input dialog.final DialogPane.Dialog<String> showTextInput(String title, String message, String text, boolean multiline) Creates and shows a text input dialog.final DialogPane.Dialog<String> showTextInput(String title, String message, String prompt, String text, boolean multiline) Creates and shows a text input dialog.final DialogPane.Dialog<String> showTextInput(String title, String message, String prompt, String text, boolean multiline, List<javafx.scene.control.ButtonType> buttonTypes) Creates and shows a text input dialog.final DialogPane.Dialog<javafx.scene.control.ButtonType> showWarning(String title, String message) Creates and shows a warning dialog.final DialogPane.Dialog<javafx.scene.control.ButtonType> showWarning(String title, String message, List<javafx.scene.control.ButtonType> buttonTypes) Creates and shows a warning dialog.Methods inherited from class javafx.scene.layout.StackPane
alignmentProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAlignment, getAlignment, getClassCssMetaData, getContentBias, getCssMetaData, getMargin, requestLayout, setAlignment, setAlignment, setMarginMethods inherited from class javafx.scene.layout.Pane
getChildrenMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, requestFocusTraversal, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
headerFactory
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node>> headerFactoryPropertyA callback used as a factory for creating the header for each dialog. The dialog pane comes with its own built-in header factory. Applications only need to specify one if they completely want to change the appearance and / or the behaviour of the title area.- See Also:
-
dialogs
Stores the list of currently active dialogs.- See Also:
-
animationDuration
public final javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationPropertyStores the duration used to animate the fly-in / fly-out of the dialogs. The default value is 100 milliseconds.- See Also:
-
sendButtonText
public final javafx.beans.property.StringProperty sendButtonTextProperty- See Also:
-
labelSupplier
public final javafx.beans.property.ObjectProperty<Supplier<javafx.scene.control.Label>> labelSupplierPropertyA supplier used for creating the label instances that will be used by the standard dialogs.- See Also:
-
animateDialogs
public final javafx.beans.property.BooleanProperty animateDialogsPropertyDetermines if the dialogs will be animated when they appear. Animation is currently a simple fly-in / fly-out. Other animation types could be considered in the future.- See Also:
-
fadeInOut
public final javafx.beans.property.BooleanProperty fadeInOutPropertyControls whether the glass pane and the dialogs will animate their opacity during showing or hiding dialogs.- See Also:
-
showingDialog
public final javafx.beans.property.ReadOnlyBooleanProperty showingDialogPropertyA read-only property used to signal that the pane is currently showing a dialog or not.- See Also:
-
maximizedPadding
public final javafx.beans.property.DoubleProperty maximizedPaddingPropertyDefines the padding around a maximized dialog in the dialog pane. A padding of zero would result in the dialog to use the entire width and height of the dialog pane.- See Also:
-
converter
public final javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javafx.scene.control.ButtonType>> converterPropertyA string converter can be applied to easily manipulate the default text representation of the various button types. An example could for example be that the application design asks for all UPPER case letters to be used for the buttons.- See Also:
-
-
Constructor Details
-
DialogPane
public DialogPane()Constructs a new dialog pane.
-
-
Method Details
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classjavafx.scene.layout.Region
-
getGlassPane
Retrieves the glass pane associated with this dialog pane. The glass pane is a transparent overlay that can be used to block user input.- Returns:
- the glass pane object
-
getHeaderFactory
Gets the value of theheaderFactoryproperty.- Property description:
- A callback used as a factory for creating the header for each dialog. The dialog pane comes with its own built-in header factory. Applications only need to specify one if they completely want to change the appearance and / or the behaviour of the title area.
- Returns:
- the value of the
headerFactoryproperty - See Also:
-
headerFactoryProperty
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node>> headerFactoryProperty()A callback used as a factory for creating the header for each dialog. The dialog pane comes with its own built-in header factory. Applications only need to specify one if they completely want to change the appearance and / or the behaviour of the title area.- Returns:
- the header factory
- See Also:
-
setHeaderFactory
public final void setHeaderFactory(javafx.util.Callback<DialogPane.Dialog<?>, javafx.scene.Node> headerFactory) Sets the value of theheaderFactoryproperty.- Property description:
- A callback used as a factory for creating the header for each dialog. The dialog pane comes with its own built-in header factory. Applications only need to specify one if they completely want to change the appearance and / or the behaviour of the title area.
- Parameters:
headerFactory- the value for theheaderFactoryproperty- See Also:
-
getDialogs
The list of currently active / showing dialogs.- Returns:
- the list of dialogs currently showing
-
dialogsProperty
Stores the list of currently active dialogs.- Returns:
- the list of dialogs
- See Also:
-
setDialogs
Sets the value of thedialogsproperty.- Property description:
- Stores the list of currently active dialogs.
- Parameters:
dialogs- the value for thedialogsproperty- See Also:
-
getAnimationDuration
public final javafx.util.Duration getAnimationDuration()Gets the value of theanimationDurationproperty.- Property description:
- Stores the duration used to animate the fly-in / fly-out of the dialogs. The default value is 100 milliseconds.
- Returns:
- the value of the
animationDurationproperty - See Also:
-
animationDurationProperty
public final javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationProperty()Stores the duration used to animate the fly-in / fly-out of the dialogs. The default value is 100 milliseconds.- Returns:
- the animation duration
- See Also:
-
setAnimationDuration
public final void setAnimationDuration(javafx.util.Duration animationDuration) Sets the value of theanimationDurationproperty.- Property description:
- Stores the duration used to animate the fly-in / fly-out of the dialogs. The default value is 100 milliseconds.
- Parameters:
animationDuration- the value for theanimationDurationproperty- See Also:
-
showDialog
Makes the given dialog visible in the pane. A dialog can define a delay duration which will be used to delay the appearance of the dialog.- Parameters:
dialog- the dialog to show- Throws:
IllegalArgumentException- when the given dialog belongs to a different dialog pane- See Also:
-
hideDialog
Hides the given dialog.- Parameters:
dialog- the dialog to hide
-
hideAllDialogs
public void hideAllDialogs()Hides all currently active dialogs.- See Also:
-
showError
Creates and shows an error message dialog.- Parameters:
title- the title for the dialogmessage- the main error message- Returns:
- the dialog
-
showError
Creates and shows an error message dialog.- Parameters:
title- the title for the dialogmessage- the main error messageexception- an exception that will be used to provide more details- Returns:
- the dialog
-
showError
Creates and shows an error message dialog.- Parameters:
title- the title for the dialogexception- an exception that will be used to provide the main message additional details- Returns:
- the dialog
-
showError
Creates and shows an error message dialog.- Parameters:
title- the title for the dialogmessage- the main error messagedetails- additional details- Returns:
- the dialog
-
showError
public final DialogPane.Dialog<Void> showError(String title, String message, String details, Runnable onSend) Creates and shows an error message dialog.- Parameters:
title- the title for the dialogmessage- the main error messagedetails- additional detailsonSend- an optional action to send out / forward the error message- Returns:
- the dialog
-
getSendButtonText
Gets the value of thesendButtonTextproperty.- Property description:
- Returns:
- the value of the
sendButtonTextproperty - See Also:
-
sendButtonTextProperty
public final javafx.beans.property.StringProperty sendButtonTextProperty()- Returns:
- the
sendButtonTextproperty - See Also:
-
setSendButtonText
Sets the value of thesendButtonTextproperty.- Property description:
- Parameters:
sendButtonText- the value for thesendButtonTextproperty- See Also:
-
showWarning
public final DialogPane.Dialog<javafx.scene.control.ButtonType> showWarning(String title, String message) Creates and shows a warning dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the warning message- Returns:
- the dialog
-
showWarning
public final DialogPane.Dialog<javafx.scene.control.ButtonType> showWarning(String title, String message, List<javafx.scene.control.ButtonType> buttonTypes) Creates and shows a warning dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the warning message- Returns:
- the dialog
-
showConfirmation
public final DialogPane.Dialog<javafx.scene.control.ButtonType> showConfirmation(String title, String message) Creates and shows a confirmation dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the main message, usually a question- Returns:
- the dialog
-
showConfirmation
public final DialogPane.Dialog<javafx.scene.control.ButtonType> showConfirmation(String title, String message, List<javafx.scene.control.ButtonType> buttonTypes) Creates and shows a confirmation dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the main message, usually a questionbuttonTypes- the buttons to show in the footer- Returns:
- the dialog
-
showInformation
public final DialogPane.Dialog<javafx.scene.control.ButtonType> showInformation(String title, String message) Creates and shows an information dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the main message, usually a question- Returns:
- the dialog
-
showInformation
public final DialogPane.Dialog<javafx.scene.control.ButtonType> showInformation(String title, String message, List<javafx.scene.control.ButtonType> buttons) Creates and shows an information dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the main message, usually a questionbuttons- the list of buttons to create in the footer / button bar- Returns:
- the dialog
-
showTextInput
Creates and shows a text input dialog.- Parameters:
title- the text shown in the header of the dialogtext- the initial text to show- Returns:
- the dialog
-
showTextInput
Creates and shows a text input dialog.- Parameters:
title- the text shown in the header of the dialogtext- the initial text to showmultiline- if true the dialog will show a text area, otherwise a text field- Returns:
- the dialog
-
showTextInput
public final DialogPane.Dialog<String> showTextInput(String title, String message, String text, boolean multiline) Creates and shows a text input dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the main message, usually a questiontext- the initial text to showmultiline- if true the dialog will show a text area, otherwise a text field- Returns:
- the dialog
-
showTextInput
public final DialogPane.Dialog<String> showTextInput(String title, String message, String prompt, String text, boolean multiline) Creates and shows a text input dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the main message, usually a questionprompt- the prompt text for the text input controltext- the initial text to showmultiline- if true the dialog will show a text area, otherwise a text field- Returns:
- the dialog
-
showTextInput
public final DialogPane.Dialog<String> showTextInput(String title, String message, String prompt, String text, boolean multiline, List<javafx.scene.control.ButtonType> buttonTypes) Creates and shows a text input dialog.- Parameters:
title- the text shown in the header of the dialogmessage- the main message, usually a questionprompt- the prompt text for the text input controltext- the initial text to showmultiline- if true the dialog will show a text area, otherwise a text field- Returns:
- the dialog
-
showNode
public final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node) Shows an arbitrary node in a dialog.- Type Parameters:
T- the type of the value provided by the dialog- Parameters:
type- the type of dialog (info, warning, error, ....)title- the text shown in the title section / header of the dialognode- the node to show- Returns:
- the dialog
-
showNode
public final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize) Shows an arbitrary node in a dialog.- Type Parameters:
T- the type of the value provided by the dialog- Parameters:
type- the type of dialog (info, warning, error, ....)title- the text shown in the title section / header of the dialognode- the node to showmaximize- if true the dialog will use the maximum size available- Returns:
- the dialog
-
showNode
public final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, List<javafx.scene.control.ButtonType> buttons) Shows an arbitrary node in a dialog.- Type Parameters:
T- the type of the value provided by the dialog- Parameters:
type- the type of dialog (info, warning, error, ....)title- the text shown in the title section / header of the dialognode- the node to showbuttons- a list of buttons to create inside the footer / button bar- Returns:
- the dialog
-
showNode
public final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize, List<javafx.scene.control.ButtonType> buttons) Shows an arbitrary node in a dialog.- Type Parameters:
T- the type of the value provided by the dialog- Parameters:
type- the type of dialog (info, warning, error, ....)title- the text shown in the title section / header of the dialognode- the node to showmaximize- if true the dialog will use the maximum size availablebuttons- a list of buttons to create inside the footer / button bar- Returns:
- the dialog
-
showNode
public final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize, List<javafx.scene.control.ButtonType> buttons, boolean sameWidthButtons) Shows an arbitrary node in a dialog.- Type Parameters:
T- the type of the value provided by the dialog- Parameters:
type- the type of dialog (info, warning, error, ....)title- the text shown in the title section / header of the dialognode- the node to showmaximize- if true the dialog will use the maximum size availablebuttons- a list of buttons to create inside the footer / button barsameWidthButtons- if true all buttons in the footer / button bar will have the same width- Returns:
- the dialog
-
showNode
public final <T> DialogPane.Dialog<T> showNode(DialogPane.Type type, String title, javafx.scene.Node node, boolean maximize, List<javafx.scene.control.ButtonType> buttons, boolean sameWidthButtons, javafx.beans.property.BooleanProperty validProperty) Shows an arbitrary node in a dialog.- Type Parameters:
T- the type of the value provided by the dialog- Parameters:
type- the type of dialog (info, warning, error, ....)title- the text shown in the title section / header of the dialognode- the node to showmaximize- if true the dialog will use the maximum size availablebuttons- a list of buttons to create inside the footer / button barsameWidthButtons- if true all buttons in the footer / button bar will have the same widthvalidProperty- a validity property that will be bound to the validity property of the dialog- Returns:
- the dialog
-
showBusyIndicator
Creates and shows a dialog that shows a busy indicator / busy animation.- Returns:
- the created dialog
-
getLabelSupplier
Gets the value of thelabelSupplierproperty.- Property description:
- A supplier used for creating the label instances that will be used by the standard dialogs.
- Returns:
- the value of the
labelSupplierproperty - See Also:
-
labelSupplierProperty
public final javafx.beans.property.ObjectProperty<Supplier<javafx.scene.control.Label>> labelSupplierProperty()A supplier used for creating the label instances that will be used by the standard dialogs.- Returns:
- the label supplier / callback / factory
- See Also:
-
setLabelSupplier
Sets the value of thelabelSupplierproperty.- Property description:
- A supplier used for creating the label instances that will be used by the standard dialogs.
- Parameters:
labelSupplier- the value for thelabelSupplierproperty- See Also:
-
animateDialogsProperty
public final javafx.beans.property.BooleanProperty animateDialogsProperty()Determines if the dialogs will be animated when they appear. Animation is currently a simple fly-in / fly-out. Other animation types could be considered in the future.- Returns:
- true if the dialog will be animated when appearing / disappearing
- See Also:
-
isAnimateDialogs
public final boolean isAnimateDialogs()Gets the value of theanimateDialogsproperty.- Property description:
- Determines if the dialogs will be animated when they appear. Animation is currently a simple fly-in / fly-out. Other animation types could be considered in the future.
- Returns:
- the value of the
animateDialogsproperty - See Also:
-
setAnimateDialogs
public final void setAnimateDialogs(boolean animate) Sets the value of theanimateDialogsproperty.- Property description:
- Determines if the dialogs will be animated when they appear. Animation is currently a simple fly-in / fly-out. Other animation types could be considered in the future.
- Parameters:
animate- the value for theanimateDialogsproperty- See Also:
-
fadeInOutProperty
public final javafx.beans.property.BooleanProperty fadeInOutProperty()Controls whether the glass pane and the dialogs will animate their opacity during showing or hiding dialogs.- Returns:
- true if fade-in / fade-out will be used for showing / hiding dialogs
- See Also:
-
isFadeInOut
public final boolean isFadeInOut()Gets the value of thefadeInOutproperty.- Property description:
- Controls whether the glass pane and the dialogs will animate their opacity during showing or hiding dialogs.
- Returns:
- the value of the
fadeInOutproperty - See Also:
-
setFadeInOut
public final void setFadeInOut(boolean animate) Sets the value of thefadeInOutproperty.- Property description:
- Controls whether the glass pane and the dialogs will animate their opacity during showing or hiding dialogs.
- Parameters:
animate- the value for thefadeInOutproperty- See Also:
-
showingDialogProperty
public final javafx.beans.property.ReadOnlyBooleanProperty showingDialogProperty()A read-only property used to signal that the pane is currently showing a dialog or not.- Returns:
- true if at least one dialog is currently showing
- See Also:
-
isShowingDialog
public final boolean isShowingDialog()Gets the value of theshowingDialogproperty.- Property description:
- A read-only property used to signal that the pane is currently showing a dialog or not.
- Returns:
- the value of the
showingDialogproperty - See Also:
-
getMaximizedPadding
public final double getMaximizedPadding()Gets the value of themaximizedPaddingproperty.- Property description:
- Defines the padding around a maximized dialog in the dialog pane. A padding of zero would result in the dialog to use the entire width and height of the dialog pane.
- Returns:
- the value of the
maximizedPaddingproperty - See Also:
-
maximizedPaddingProperty
public final javafx.beans.property.DoubleProperty maximizedPaddingProperty()Defines the padding around a maximized dialog in the dialog pane. A padding of zero would result in the dialog to use the entire width and height of the dialog pane.- Returns:
- the padding around a maximized dialog
- See Also:
-
setMaximizedPadding
public final void setMaximizedPadding(double maximizedPadding) Sets the value of themaximizedPaddingproperty.- Property description:
- Defines the padding around a maximized dialog in the dialog pane. A padding of zero would result in the dialog to use the entire width and height of the dialog pane.
- Parameters:
maximizedPadding- the value for themaximizedPaddingproperty- See Also:
-
layoutChildren
protected void layoutChildren()- Overrides:
layoutChildrenin classjavafx.scene.layout.StackPane
-
getConverter
public final javafx.util.StringConverter<javafx.scene.control.ButtonType> getConverter()Gets the value of theconverterproperty.- Property description:
- A string converter can be applied to easily manipulate the default text representation of the various button types. An example could for example be that the application design asks for all UPPER case letters to be used for the buttons.
- Returns:
- the value of the
converterproperty - See Also:
-
converterProperty
public final javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javafx.scene.control.ButtonType>> converterProperty()A string converter can be applied to easily manipulate the default text representation of the various button types. An example could for example be that the application design asks for all UPPER case letters to be used for the buttons.- Returns:
- a string converter
- See Also:
-
setConverter
public final void setConverter(javafx.util.StringConverter<javafx.scene.control.ButtonType> converter) Sets the value of theconverterproperty.- Property description:
- A string converter can be applied to easily manipulate the default text representation of the various button types. An example could for example be that the application design asks for all UPPER case letters to be used for the buttons.
- Parameters:
converter- the value for theconverterproperty- See Also:
-