Interface NotificationBuilder

All Known Implementing Classes:
DefaultNotificationBuilder

public interface NotificationBuilder
Builder for notifications.
Notifications are a lightweight alternative to Alerts. While the latter are Dialogs, tentackle notifications come as Parent nodes, that can be used in any container, i.e. a Popup, Dialog, part of scenegraph or whatever.

Not to be mixed up with Notes.

  • Method Details

    • type

      Sets the notification type.
      Parameters:
      type - the type
      Returns:
      the builder
    • graphic

      NotificationBuilder graphic(javafx.scene.Node graphic)
      Sets the graphic.
      Parameters:
      graphic - the graphic
      Returns:
      the builder
    • title

      Sets the title.
      Parameters:
      title - the title
      Returns:
      the builder
    • text

      Sets the text message.
      Parameters:
      text - the message
      Returns:
      the builder
    • details

      NotificationBuilder details(String details)
      Sets the detail message.
      A stacktrace, for example.

      Notice that details are ignored if content(Node) is set.

      Parameters:
      details - the details
      Returns:
      the builder
    • content

      NotificationBuilder content(javafx.scene.Node content)
      Sets a node as an alternative to details.
      Parameters:
      content - the content node
      Returns:
      the builder
    • fadeIn

      NotificationBuilder fadeIn(long fadeIn)
      Sets a fadein effect to show the notification smoothly.
      Parameters:
      fadeIn - the time to fade in [ms]
      Returns:
      the builder
    • duration

      NotificationBuilder duration(long duration)
      Sets a duration to close the notification automatically.
      Ignored if there is no hide action.
      Parameters:
      duration - the time the dialog should be visible [ms]
      Returns:
      the builder
    • fadeOut

      NotificationBuilder fadeOut(long fadeOut)
      Sets a fadeout effect to close the notification smoothly.
      Ignored if there is no hide action.
      Parameters:
      fadeOut - the time to fade out [ms]
      Returns:
      the builder
    • button

      NotificationBuilder button(String text, javafx.scene.Node graphic, boolean isDefault, Runnable action)
      Adds a button.
      Parameters:
      text - the button's text
      graphic - the button's graphic
      isDefault - true if this is the default button
      action - the action to perform when clicked
      Returns:
      the builder
    • closeButton

      Sets the close button mode.
      Parameters:
      closeButtonMode - the close button mode
      Returns:
      the builder
    • hide

      Sets the hide action when a button is pressed.
      Parameters:
      hide - the action to close or hide the notification
      Returns:
      the builder
    • css

      Applies a CSS stylesheet.
      Overrides the default stylesheet org/tentackle/fx/notification.css.
      Parameters:
      css - the stylesheet
      Returns:
      the builder
    • build

      javafx.scene.Parent build()
      Creates the notification.
      Returns:
      the notification
    • getTitle

      String 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.
      Returns:
      the title