- All Implemented Interfaces:
Styleable,EventTarget
- Direct Known Subclasses:
MFXFilterDialog
It is composed of three main parts:
- the header: which is an HBox containing an icon(optional) and a Label
to show the headerTextProperty(). It also contains three buttons to minimize, close and
set always on top. All three of them can be hidden. By default they don't do anything, they have been
added since this dialog in indented to be used in conjunction with MFXStageDialog, see
MFXGenericDialogBuilder.toStageDialogBuilder() for an example on how those buttons are used
- the content: which is just a Label to show the contentTextProperty(), the
content can be easily changed in many ways: you can set the property contentProperty(),
you can override buildContent() or you can override buildScrollableContent(boolean).
By default the dialog uses the content built by buildContent(). The other method, buildScrollableContent(boolean),
by default is just wrapping the buildContent() result in a MFXScrollPane
- the footer/actions: which is a HBox or VBox (depending on the actionsOrientationProperty()),
which contains a list of arbitrary nodes specified by the user through: addActions(Node...) or addActions(Map.Entry[]),
you can also clear them with clearActions(). Note that despite being generic Nodes, it is intended to be used
with buttons and the like
alwaysOnTopProperty(), also has a new related PseudoClass: ":always-on-top".-
Property Summary
PropertiesTypePropertyDescriptionSpecifies theOrientationof the actions pane.Specifies whether the dialog should be always on top.Specifies the dialog's content.Specifies the dialog's content text.Specifies the header's label iconSpecifies the header's label text.Specifies the action to perform when the always on top button is pressed.Specifies the action to perform when the close button is pressed.Specifies the action to perform when the minimize button is pressed.Specifies whether to show the always on top button in the header.Specifies whether to show the close button in the header.Specifies whether to show the minimize button in the header.Properties 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, 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
FieldsModifier and TypeFieldDescriptionprotected Paneprotected static final PseudoClassprotected MFXIconWrapperprotected MFXIconWrapperprotected HBoxprotected Labelprotected MFXIconWrapperFields 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 TypeMethodDescriptionSpecifies theOrientationof the actions pane.final voidaddActions(Map.Entry<Node, EventHandler<MouseEvent>>... actions) Each entry has aNodethat will trigger the given action onMouseEvent.MOUSE_CLICKED.voidaddActions(Node... actions) Adds the specified nodes to the actions pane.Specifies whether the dialog should be always on top.protected voidBuilds the actions pane according to theactionsOrientationProperty().protected voidBuilds the default dialog's content.protected voidBuilds the default header.protected voidbuildScrollableContent(boolean smoothScrolling) Builds the same nodes asbuildContent()but wrapped in aMFXScrollPane.voidRemoves all the nodes from the actions pane.Specifies the dialog's content.Specifies the dialog's content text.Gets the value of the property actionsOrientation.Gets the value of the property content.Gets the value of the property contentText.Gets the value of the property headerIcon.Gets the value of the property headerText.Gets the value of the property onAlwaysOnTop.Gets the value of the property onClose.Gets the value of the property onMinimize.Specifies the header's label iconSpecifies the header's label text.booleanGets the value of the property alwaysOnTop.booleanGets the value of the property showAlwaysOnTop.booleanGets the value of the property showClose.booleanGets the value of the property showMinimize.Specifies the action to perform when the always on top button is pressed.Specifies the action to perform when the close button is pressed.Specifies the action to perform when the minimize button is pressed.voidsetActionsOrientation(Orientation actionsOrientation) Sets the value of the property actionsOrientation.voidsetAlwaysOnTop(boolean alwaysOnTop) Sets the value of the property alwaysOnTop.voidsetContent(Node content) Sets the value of the property content.voidsetContentText(String contentText) Sets the value of the property contentText.voidsetHeaderIcon(Node headerIcon) Sets the value of the property headerIcon.voidsetHeaderText(String headerText) Sets the value of the property headerText.voidsetOnAlwaysOnTop(EventHandler<MouseEvent> onAlwaysOnTop) Sets the value of the property onAlwaysOnTop.voidsetOnClose(EventHandler<MouseEvent> onClose) Sets the value of the property onClose.voidsetOnMinimize(EventHandler<MouseEvent> onMinimize) Sets the value of the property onMinimize.voidsetShowAlwaysOnTop(boolean showAlwaysOnTop) Sets the value of the property showAlwaysOnTop.voidsetShowClose(boolean showClose) Sets the value of the property showClose.voidsetShowMinimize(boolean showMinimize) Sets the value of the property showMinimize.Specifies whether to show the always on top button in the header.Specifies whether to show the close button in the header.Specifies whether to show the minimize button in the header.Methods inherited from class io.github.palexdev.materialfx.dialogs.AbstractMFXDialog
computeMaxHeight, computeMaxWidthMethods inherited from class javafx.scene.layout.BorderPane
bottomProperty, centerProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAlignment, getBottom, getCenter, getContentBias, getLeft, getMargin, getRight, getTop, layoutChildren, leftProperty, rightProperty, setAlignment, setBottom, setCenter, setLeft, setMargin, setRight, setTop, topPropertyMethods inherited from class javafx.scene.layout.Pane
getChildrenMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getClassCssMetaData, getCssMetaData, 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, requestLayout, 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, 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, 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, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
headerIcon
Specifies the header's label icon- See Also:
-
headerText
Specifies the header's label text.- See Also:
-
content
Specifies the dialog's content.- See Also:
-
contentText
Specifies the dialog's content text.- See Also:
-
showClose
Specifies whether to show the close button in the header.- See Also:
-
showMinimize
Specifies whether to show the minimize button in the header.- See Also:
-
showAlwaysOnTop
Specifies whether to show the always on top button in the header. -
actionsOrientation
Specifies theOrientationof the actions pane. -
onClose
Specifies the action to perform when the close button is pressed.- See Also:
-
onMinimize
Specifies the action to perform when the minimize button is pressed.- See Also:
-
onAlwaysOnTop
Specifies the action to perform when the always on top button is pressed. -
alwaysOnTop
Specifies whether the dialog should be always on top. (see class documentation for further details)- See Also:
-
-
Field Details
-
header
-
headerLabel
-
alwaysOnTopIcon
-
minimizeIcon
-
closeIcon
-
actions
-
ALWAYS_ON_TOP_PSEUDO_CLASS
-
-
Constructor Details
-
MFXGenericDialog
public MFXGenericDialog() -
MFXGenericDialog
-
-
Method Details
-
buildHeader
protected void buildHeader()Builds the default header. -
buildContent
protected void buildContent()Builds the default dialog's content. -
buildScrollableContent
protected void buildScrollableContent(boolean smoothScrolling) Builds the same nodes asbuildContent()but wrapped in aMFXScrollPane.- Parameters:
smoothScrolling- to specify whether to use smooth scrolling on theMFXScrollPane
-
buildActionsPane
protected void buildActionsPane()Builds the actions pane according to theactionsOrientationProperty(). Note that actions are preserved when changing the Orientation. -
addActions
Adds the specified nodes to the actions pane. -
addActions
Each entry has aNodethat will trigger the given action onMouseEvent.MOUSE_CLICKED.For each entry, adds the given
EventHandlerto the givenNode, than adds it to the actions pane. -
clearActions
public void clearActions()Removes all the nodes from the actions pane. -
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classRegion
-
getHeaderIcon
Gets the value of the property headerIcon.- Property description:
- Specifies the header's label icon
-
headerIconProperty
Specifies the header's label icon- See Also:
-
setHeaderIcon
Sets the value of the property headerIcon.- Property description:
- Specifies the header's label icon
-
getHeaderText
Gets the value of the property headerText.- Property description:
- Specifies the header's label text.
-
headerTextProperty
Specifies the header's label text.- See Also:
-
setHeaderText
Sets the value of the property headerText.- Property description:
- Specifies the header's label text.
-
getContent
Gets the value of the property content.- Property description:
- Specifies the dialog's content.
-
contentProperty
Specifies the dialog's content.- See Also:
-
setContent
Sets the value of the property content.- Property description:
- Specifies the dialog's content.
-
getContentText
Gets the value of the property contentText.- Property description:
- Specifies the dialog's content text.
-
contentTextProperty
Specifies the dialog's content text.- See Also:
-
setContentText
Sets the value of the property contentText.- Property description:
- Specifies the dialog's content text.
-
isShowClose
public boolean isShowClose()Gets the value of the property showClose.- Property description:
- Specifies whether to show the close button in the header.
-
showCloseProperty
Specifies whether to show the close button in the header.- See Also:
-
setShowClose
public void setShowClose(boolean showClose) Sets the value of the property showClose.- Property description:
- Specifies whether to show the close button in the header.
-
isShowMinimize
public boolean isShowMinimize()Gets the value of the property showMinimize.- Property description:
- Specifies whether to show the minimize button in the header.
-
showMinimizeProperty
Specifies whether to show the minimize button in the header.- See Also:
-
setShowMinimize
public void setShowMinimize(boolean showMinimize) Sets the value of the property showMinimize.- Property description:
- Specifies whether to show the minimize button in the header.
-
isShowAlwaysOnTop
public boolean isShowAlwaysOnTop()Gets the value of the property showAlwaysOnTop.- Property description:
- Specifies whether to show the always on top button in the header.
-
showAlwaysOnTopProperty
Specifies whether to show the always on top button in the header. -
setShowAlwaysOnTop
public void setShowAlwaysOnTop(boolean showAlwaysOnTop) Sets the value of the property showAlwaysOnTop.- Property description:
- Specifies whether to show the always on top button in the header.
-
getActionsOrientation
Gets the value of the property actionsOrientation.- Property description:
- Specifies the
Orientationof the actions pane.
-
actionsOrientationProperty
Specifies theOrientationof the actions pane. -
setActionsOrientation
Sets the value of the property actionsOrientation.- Property description:
- Specifies the
Orientationof the actions pane.
-
getOnClose
Gets the value of the property onClose.- Property description:
- Specifies the action to perform when the close button is pressed.
-
onCloseProperty
Specifies the action to perform when the close button is pressed.- See Also:
-
setOnClose
Sets the value of the property onClose.- Property description:
- Specifies the action to perform when the close button is pressed.
-
getOnMinimize
Gets the value of the property onMinimize.- Property description:
- Specifies the action to perform when the minimize button is pressed.
-
onMinimizeProperty
Specifies the action to perform when the minimize button is pressed.- See Also:
-
setOnMinimize
Sets the value of the property onMinimize.- Property description:
- Specifies the action to perform when the minimize button is pressed.
-
getOnAlwaysOnTop
Gets the value of the property onAlwaysOnTop.- Property description:
- Specifies the action to perform when the always on top button is pressed.
-
onAlwaysOnTopProperty
Specifies the action to perform when the always on top button is pressed. -
setOnAlwaysOnTop
Sets the value of the property onAlwaysOnTop.- Property description:
- Specifies the action to perform when the always on top button is pressed.
-
isAlwaysOnTop
public boolean isAlwaysOnTop()Gets the value of the property alwaysOnTop.- Property description:
- Specifies whether the dialog should be always on top. (see class documentation for further details)
-
alwaysOnTopProperty
Specifies whether the dialog should be always on top. (see class documentation for further details)- See Also:
-
setAlwaysOnTop
public void setAlwaysOnTop(boolean alwaysOnTop) Sets the value of the property alwaysOnTop.- Property description:
- Specifies whether the dialog should be always on top. (see class documentation for further details)
-