- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- org.controlsfx.control.NotificationPane
-
- All Implemented Interfaces:
Styleable
,EventTarget
,Skinnable
public class NotificationPane extends Control
The NotificationPane control is a container control that, when prompted by theshow()
method, will show a non-modal message to the user. The notification appears as a bar that will slide in to their application window, either from the top or the bottom of the NotificationPane (based onshowFromTopProperty()
) wherever that may be in the scenegraph.Alternative Styling
As is visible in the screenshots further down this documentation, there are two different styles supported by the NotificationPane control. Firstly, there is the default style based on the JavaFX Modena look. The alternative style is what is currently referred to as the 'dark' look. To enable this functionality, simply do the following:
NotificationPane notificationPane = new NotificationPane(); notificationPane.getStyleClass().add(NotificationPane.STYLE_CLASS_DARK);
Screenshots
To better explain NotificationPane, here is a table showing both the default and dark look for the NotificationPane on a Windows machine (although that shouldn't impact the visuals a great deal). Also, to show the difference between top and bottom placement, these two modes are also captured in the screenshots below:
Setting
Screenshot
Light theme from top: Light theme from bottom: Dark theme from top: Dark theme from bottom: Code Examples
NotificationPane is a conceptually very simple control - you simply create your user interface as you normally would, and then wrap it inside the NotificationPane. You can then show a notification bar on top of your content simply by calling
show()
on the notification bar. Here is an example:// Create a WebView WebView webView = new WebView(); // Wrap it inside a NotificationPane NotificationPane notificationPane = new NotificationPane(webView); // and put the NotificationPane inside a Tab Tab tab1 = new Tab("Tab 1"); tab1.setContent(notificationPane); // and the Tab inside a TabPane. We just have one tab here, but of course // you can have more! TabPane tabPane = new TabPane(); tabPane.getTabs().addAll(tab1);
Now that the notification pane is installed inside the tab, at some point later in you application lifecycle, you can do something like the following to have the notification bar slide into view:
notificationPane.setText("Do you want to save your password?"); notificationPane.getActions().add(new AbstractAction("Save Password") { public void execute(ActionEvent ae) { // do save... // then hide... notificationPane.hide(); } }
- See Also:
Action
-
-
Property Summary
Properties Type Property Description BooleanProperty
closeButtonVisible
A property representing whether the close button in theNotificationPane
should be visible or not.ObjectProperty<Node>
content
The content property represents what is shown in the scene that is not within the notification bar.ObjectProperty<Node>
graphic
ObjectProperty<EventHandler<Event>>
onHidden
ObjectProperty<EventHandler<Event>>
onHiding
ObjectProperty<EventHandler<Event>>
onShowing
ObjectProperty<EventHandler<Event>>
onShown
BooleanProperty
showFromTop
A property representing whether the notification bar should appear from the top or the bottom of the NotificationPane area.ReadOnlyBooleanProperty
showing
A read-only property that represents whether the notification bar popup should be showing to the user or not.StringProperty
text
The text property represents the text to show within the popup notification bar that appears on top of thecontent
that is within the NotificationPane.-
Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
-
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, width
-
Properties inherited from class javafx.scene.Parent
needsLayout
-
Properties 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
Fields Modifier and Type Field Description static EventType<Event>
ON_HIDDEN
Called when the NotificationPane is hidden.static EventType<Event>
ON_HIDING
Called when the NotificationPane will be hidden.static EventType<Event>
ON_SHOWING
Called when the NotificationPane will be shown.static EventType<Event>
ON_SHOWN
Called when the NotificationPane shows.static String
STYLE_CLASS_DARK
Static fields-
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
-
Constructor Summary
Constructors Constructor Description NotificationPane()
NotificationPane(Node content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanProperty
closeButtonVisibleProperty()
A property representing whether the close button in theNotificationPane
should be visible or not.ObjectProperty<Node>
contentProperty()
The content property represents what is shown in the scene that is not within the notification bar.protected Skin<?>
createDefaultSkin()
ObservableList<Action>
getActions()
Observable list of actions used for the actions area of the notification bar.Node
getContent()
Node
getGraphic()
EventHandler<Event>
getOnHidden()
Gets the value of the property onHidden.EventHandler<Event>
getOnHiding()
Gets the value of the property onHiding.EventHandler<Event>
getOnShowing()
Gets the value of the property onShowing.EventHandler<Event>
getOnShown()
Gets the value of the property onShown.String
getText()
String
getUserAgentStylesheet()
protected String
getUserAgentStylesheet(Class<?> clazz, String fileName)
A helper method that ensures that the resource based lookup of the user agent stylesheet only happens once.ObjectProperty<Node>
graphicProperty()
void
hide()
Call this to make the notification bar disappear from thecontent
of thisNotificationPane
.boolean
isCloseButtonVisible()
boolean
isShowFromTop()
boolean
isShowing()
ObjectProperty<EventHandler<Event>>
onHiddenProperty()
ObjectProperty<EventHandler<Event>>
onHidingProperty()
ObjectProperty<EventHandler<Event>>
onShowingProperty()
ObjectProperty<EventHandler<Event>>
onShownProperty()
void
setCloseButtonVisible(boolean value)
Sets whether the close button inNotificationPane
should be visible.void
setContent(Node value)
Set the content to be shown in the scene, that is not within the notification bar.void
setGraphic(Node value)
Sets theNode
to show within the popup notification bar.void
setOnHidden(EventHandler<Event> value)
Called just after theNotificationPane
has been hidden.void
setOnHiding(EventHandler<Event> value)
Called just prior to theNotificationPane
being hidden.void
setOnShowing(EventHandler<Event> value)
Called just prior to theNotificationPane
being shown.void
setOnShown(EventHandler<Event> value)
Called just after theNotificationPane
is shown.void
setShowFromTop(boolean value)
Sets whether the notification bar should appear from the top or the bottom of the NotificationPane area.void
setText(String value)
Sets the text to show within the popup notification bar that appears on top of thecontent
.void
show()
Call this to make the notification bar appear on top of thecontent
of thisNotificationPane
.void
show(String text)
void
show(String text, Node graphic)
void
show(String text, Node graphic, Action... actions)
BooleanProperty
showFromTopProperty()
A property representing whether the notification bar should appear from the top or the bottom of the NotificationPane area.ReadOnlyBooleanProperty
showingProperty()
A read-only property that represents whether the notification bar popup should be showing to the user or not.StringProperty
textProperty()
The text property represents the text to show within the popup notification bar that appears on top of thecontent
that is within the NotificationPane.-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, 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, widthProperty
-
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Methods 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, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, 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, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Property Detail
-
content
public final ObjectProperty<Node> contentProperty
The content property represents what is shown in the scene that is not within the notification bar. In other words, it is what the notification bar should appear on top of. For example, in the scenario where you are using a WebView to show to the user websites, and you want to popup up a notification bar to save a password, the content would be the WebView. Refer to theNotificationPane
class documentation for more details.- Returns:
- A property representing the content of this NotificationPane.
-
text
public final StringProperty textProperty
The text property represents the text to show within the popup notification bar that appears on top of thecontent
that is within the NotificationPane.- See Also:
getText()
,setText(String)
-
graphic
public final ObjectProperty<Node> graphicProperty
The graphic property represents theNode
to show within the popup notification bar that appears on top of thecontent
that is within the NotificationPane. Despite the term 'graphic', this can be an arbitrarily complex scenegraph in its own right.- See Also:
getGraphic()
,setGraphic(Node)
-
showing
public final ReadOnlyBooleanProperty showingProperty
A read-only property that represents whether the notification bar popup should be showing to the user or not. To toggle visibility, use theshow()
andhide()
methods.- See Also:
isShowing()
-
showFromTop
public final BooleanProperty showFromTopProperty
A property representing whether the notification bar should appear from the top or the bottom of the NotificationPane area. By default it will appear from the top, but this can be changed by setting this property to false.- See Also:
isShowFromTop()
,setShowFromTop(boolean)
-
onShowing
public final ObjectProperty<EventHandler<Event>> onShowingProperty
- See Also:
getOnShowing()
,setOnShowing(EventHandler)
-
onShown
public final ObjectProperty<EventHandler<Event>> onShownProperty
- See Also:
getOnShown()
,setOnShown(EventHandler)
-
onHiding
public final ObjectProperty<EventHandler<Event>> onHidingProperty
- See Also:
getOnHiding()
,setOnHiding(EventHandler)
-
onHidden
public final ObjectProperty<EventHandler<Event>> onHiddenProperty
- See Also:
getOnHidden()
,setOnHidden(EventHandler)
-
closeButtonVisible
public final BooleanProperty closeButtonVisibleProperty
A property representing whether the close button in theNotificationPane
should be visible or not. By default it will appear but this can be changed by setting this property to false.
-
-
Field Detail
-
STYLE_CLASS_DARK
public static final String STYLE_CLASS_DARK
Static fields- See Also:
- Constant Field Values
-
ON_SHOWING
public static final EventType<Event> ON_SHOWING
Called when the NotificationPane will be shown.
-
ON_HIDING
public static final EventType<Event> ON_HIDING
Called when the NotificationPane will be hidden.
-
-
Constructor Detail
-
NotificationPane
public NotificationPane()
-
NotificationPane
public NotificationPane(Node content)
Creates an instance of NotificationPane with thecontent
property set, but notext
orgraphic
property set, and noactions
specified.- Parameters:
content
- The content to show in the NotificationPane behind where the notification bar will appear, that is, the content will notappear in the notification bar.
-
-
Method Detail
-
createDefaultSkin
protected Skin<?> createDefaultSkin()
- Overrides:
createDefaultSkin
in classControl
-
getUserAgentStylesheet
public String getUserAgentStylesheet()
- Overrides:
getUserAgentStylesheet
in classRegion
-
contentProperty
public final ObjectProperty<Node> contentProperty()
The content property represents what is shown in the scene that is not within the notification bar. In other words, it is what the notification bar should appear on top of. For example, in the scenario where you are using a WebView to show to the user websites, and you want to popup up a notification bar to save a password, the content would be the WebView. Refer to theNotificationPane
class documentation for more details.- Returns:
- A property representing the content of this NotificationPane.
-
setContent
public final void setContent(Node value)
Set the content to be shown in the scene, that is not within the notification bar.- Parameters:
value
-
-
getContent
public final Node getContent()
- Returns:
- The content shown in the scene.
-
textProperty
public final StringProperty textProperty()
The text property represents the text to show within the popup notification bar that appears on top of thecontent
that is within the NotificationPane.- See Also:
getText()
,setText(String)
-
setText
public final void setText(String value)
Sets the text to show within the popup notification bar that appears on top of thecontent
.- Parameters:
value
-
-
getText
public final String getText()
- Returns:
- the text showing within the popup
notification bar that appears on top of the
content
.
-
graphicProperty
public final ObjectProperty<Node> graphicProperty()
The graphic property represents theNode
to show within the popup notification bar that appears on top of thecontent
that is within the NotificationPane. Despite the term 'graphic', this can be an arbitrarily complex scenegraph in its own right.- See Also:
getGraphic()
,setGraphic(Node)
-
setGraphic
public final void setGraphic(Node value)
Sets theNode
to show within the popup notification bar.- Parameters:
value
-
-
getGraphic
public final Node getGraphic()
- Returns:
- the
Node
to show within the popup notification bar.
-
showingProperty
public final ReadOnlyBooleanProperty showingProperty()
A read-only property that represents whether the notification bar popup should be showing to the user or not. To toggle visibility, use theshow()
andhide()
methods.- See Also:
isShowing()
-
isShowing
public final boolean isShowing()
- Returns:
- whether the notification bar is currently showing.
-
showFromTopProperty
public final BooleanProperty showFromTopProperty()
A property representing whether the notification bar should appear from the top or the bottom of the NotificationPane area. By default it will appear from the top, but this can be changed by setting this property to false.- See Also:
isShowFromTop()
,setShowFromTop(boolean)
-
setShowFromTop
public final void setShowFromTop(boolean value)
Sets whether the notification bar should appear from the top or the bottom of the NotificationPane area.- Parameters:
value
-
-
isShowFromTop
public final boolean isShowFromTop()
- Returns:
- whether the notification bar is appearing from the top or the bottom of the NotificationPane area.
-
onShowingProperty
public final ObjectProperty<EventHandler<Event>> onShowingProperty()
- See Also:
getOnShowing()
,setOnShowing(EventHandler)
-
setOnShowing
public final void setOnShowing(EventHandler<Event> value)
Called just prior to theNotificationPane
being shown.
-
getOnShowing
public final EventHandler<Event> getOnShowing()
Gets the value of the property onShowing.- Property description:
-
onShownProperty
public final ObjectProperty<EventHandler<Event>> onShownProperty()
- See Also:
getOnShown()
,setOnShown(EventHandler)
-
setOnShown
public final void setOnShown(EventHandler<Event> value)
Called just after theNotificationPane
is shown.
-
getOnShown
public final EventHandler<Event> getOnShown()
Gets the value of the property onShown.- Property description:
-
onHidingProperty
public final ObjectProperty<EventHandler<Event>> onHidingProperty()
- See Also:
getOnHiding()
,setOnHiding(EventHandler)
-
setOnHiding
public final void setOnHiding(EventHandler<Event> value)
Called just prior to theNotificationPane
being hidden.
-
getOnHiding
public final EventHandler<Event> getOnHiding()
Gets the value of the property onHiding.- Property description:
-
onHiddenProperty
public final ObjectProperty<EventHandler<Event>> onHiddenProperty()
- See Also:
getOnHidden()
,setOnHidden(EventHandler)
-
setOnHidden
public final void setOnHidden(EventHandler<Event> value)
Called just after theNotificationPane
has been hidden.
-
getOnHidden
public final EventHandler<Event> getOnHidden()
Gets the value of the property onHidden.- Property description:
-
closeButtonVisibleProperty
public final BooleanProperty closeButtonVisibleProperty()
A property representing whether the close button in theNotificationPane
should be visible or not. By default it will appear but this can be changed by setting this property to false.
-
setCloseButtonVisible
public final void setCloseButtonVisible(boolean value)
Sets whether the close button inNotificationPane
should be visible.- Parameters:
value
-
-
isCloseButtonVisible
public final boolean isCloseButtonVisible()
- Returns:
- whether the close button in
NotificationPane
is visible.
-
getActions
public final ObservableList<Action> getActions()
Observable list of actions used for the actions area of the notification bar. Modifying the contents of this list will change the actions available to the user.- Returns:
- The
ObservableList
of actions available to the user.
-
show
public void show()
Call this to make the notification bar appear on top of thecontent
of thisNotificationPane
. If the notification bar is already showing this will be a no-op.
-
show
public void show(String text)
Shows the NotificationPane with thecontent
andtext
property set, but nographic
property set, and noactions
specified.- Parameters:
text
- The text to show in the notification pane.
-
show
public void show(String text, Node graphic)
Shows the NotificationPane with thecontent
,text
andgraphic
properties set, but noactions
specified.- Parameters:
text
- The text to show in the notification pane.graphic
- The node to show in the notification pane.
-
show
public void show(String text, Node graphic, Action... actions)
Shows the NotificationPane with thecontent
,text
andgraphic
property set, and the provided actions copied into theactions
list.- Parameters:
text
- The text to show in the notification pane.graphic
- The node to show in the notification pane.actions
- The actions to show in the notification pane.
-
hide
public void hide()
Call this to make the notification bar disappear from thecontent
of thisNotificationPane
. If the notification bar is already hidden this will be a no-op.
-
getUserAgentStylesheet
protected final String getUserAgentStylesheet(Class<?> clazz, String fileName)
A helper method that ensures that the resource based lookup of the user agent stylesheet only happens once. Caches the external form of the resource.- Parameters:
clazz
- the class used for the resource lookupfileName
- the name of the user agent stylesheet- Returns:
- the external form of the user agent stylesheet (the path)
-
-