java.lang.Object
org.tentackle.fx.DefaultNotificationBuilder
- All Implemented Interfaces:
NotificationBuilder
Default implementation of a notification builder.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tentackle.fx.NotificationBuilder
NotificationBuilder.CloseButtonMode, NotificationBuilder.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.Parentbuild()Creates the notification.Adds a button.closeButton(NotificationBuilder.CloseButtonMode closeButtonMode) Sets the close button mode.content(javafx.scene.Node content) Sets a node as an alternative to details.Applies a CSS stylesheet.
Overrides the default stylesheetorg/tentackle/fx/notification.css.Sets the detail message.
A stacktrace, for example.duration(long duration) Sets a duration to close the notification automatically.
Ignored if there is no hide action.fadeIn(long fadeIn) Sets a fadein effect to show the notification smoothly.fadeOut(long fadeOut) Sets a fadeout effect to close the notification smoothly.
Ignored if there is no hide action.protected URLGets the default CSS URL.getTitle()Returns the title of the notification.
It depends on the implementation whether the title is already part of the node or of a window title or not visible at all.graphic(javafx.scene.Node graphic) Sets the graphic.Sets the hide action when a button is pressed.Sets the text message.Sets the title.type(NotificationBuilder.Type type) Sets the notification type.
-
Constructor Details
-
DefaultNotificationBuilder
public DefaultNotificationBuilder()
-
-
Method Details
-
type
Description copied from interface:NotificationBuilderSets the notification type.- Specified by:
typein interfaceNotificationBuilder- Parameters:
type- the type- Returns:
- the builder
-
graphic
Description copied from interface:NotificationBuilderSets the graphic.- Specified by:
graphicin interfaceNotificationBuilder- Parameters:
graphic- the graphic- Returns:
- the builder
-
title
Description copied from interface:NotificationBuilderSets the title.- Specified by:
titlein interfaceNotificationBuilder- Parameters:
title- the title- Returns:
- the builder
-
text
Description copied from interface:NotificationBuilderSets the text message.- Specified by:
textin interfaceNotificationBuilder- Parameters:
text- the message- Returns:
- the builder
-
details
Description copied from interface:NotificationBuilderSets the detail message.
A stacktrace, for example.Notice that details are ignored if
NotificationBuilder.content(Node)is set.- Specified by:
detailsin interfaceNotificationBuilder- Parameters:
details- the details- Returns:
- the builder
-
content
Description copied from interface:NotificationBuilderSets a node as an alternative to details.- Specified by:
contentin interfaceNotificationBuilder- Parameters:
content- the content node- Returns:
- the builder
-
duration
Description copied from interface:NotificationBuilderSets a duration to close the notification automatically.
Ignored if there is no hide action.- Specified by:
durationin interfaceNotificationBuilder- Parameters:
duration- the time the dialog should be visible [ms]- Returns:
- the builder
-
fadeOut
Description copied from interface:NotificationBuilderSets a fadeout effect to close the notification smoothly.
Ignored if there is no hide action.- Specified by:
fadeOutin interfaceNotificationBuilder- Parameters:
fadeOut- the time to fade out [ms]- Returns:
- the builder
-
fadeIn
Description copied from interface:NotificationBuilderSets a fadein effect to show the notification smoothly.- Specified by:
fadeInin interfaceNotificationBuilder- Parameters:
fadeIn- the time to fade in [ms]- Returns:
- the builder
-
button
public NotificationBuilder button(String text, javafx.scene.Node graphic, boolean isDefault, Runnable action) Description copied from interface:NotificationBuilderAdds a button.- Specified by:
buttonin interfaceNotificationBuilder- Parameters:
text- the button's textgraphic- the button's graphicisDefault- true if this is the default buttonaction- the action to perform when clicked- Returns:
- the builder
-
hide
Description copied from interface:NotificationBuilderSets the hide action when a button is pressed.- Specified by:
hidein interfaceNotificationBuilder- Parameters:
hide- the action to close or hide the notification- Returns:
- the builder
-
css
Description copied from interface:NotificationBuilderApplies a CSS stylesheet.
Overrides the default stylesheetorg/tentackle/fx/notification.css.- Specified by:
cssin interfaceNotificationBuilder- Parameters:
css- the stylesheet- Returns:
- the builder
-
closeButton
Description copied from interface:NotificationBuilderSets the close button mode.- Specified by:
closeButtonin interfaceNotificationBuilder- Parameters:
closeButtonMode- the close button mode- Returns:
- the builder
-
build
public javafx.scene.Parent build()Description copied from interface:NotificationBuilderCreates the notification.- Specified by:
buildin interfaceNotificationBuilder- Returns:
- the notification
-
getTitle
Description copied from interface:NotificationBuilderReturns the title of the notification.
It depends on the implementation whether the title is already part of the node or of a window title or not visible at all.- Specified by:
getTitlein interfaceNotificationBuilder- Returns:
- the title
-
getDefaultCSS
Gets the default CSS URL.- Returns:
- the URL
-