Class Notification<T>

java.lang.Object
com.dlsc.gemsfx.infocenter.Notification<T>
Type Parameters:
T - the type of the user object
All Implemented Interfaces:
Comparable<Notification<T>>

public class Notification<T> extends Object implements Comparable<Notification<T>>
A pure model object containing the data for a NotificationView. Notifications can be added to groups (NotificationGroup).
See Also:
  • Property Details

    • title

      public final javafx.beans.property.StringProperty titleProperty
      The title of the notification, e.g. "Purchase Order #123456" when this is the subject of an email for which the notification was created.
      See Also:
    • summary

      public final javafx.beans.property.StringProperty summaryProperty
      A short summary of the noteworthy thing that happened.
      See Also:
    • dateTime

      public final javafx.beans.property.ObjectProperty<ZonedDateTime> dateTimeProperty
      The time stamp for this notification.
      See Also:
    • userObject

      public final javafx.beans.property.ObjectProperty<T> userObjectProperty
      An (optional) user object for easy linking between the notification and the business object for which the notification was created, e.g. an email or a calendar entry.
      See Also:
    • expanded

      public final javafx.beans.property.BooleanProperty expandedProperty
      A flag that gets updated when the notification's group was expanded or collapsed.
      See Also:
    • onClick

      public final javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour>> onClickProperty
      A callback that determines how the notification and the view will behave when the user clicks on it. The default behaviour is to hide the view and remove the notification from its group.
      See Also:
  • Field Details

  • Constructor Details

    • Notification

      public Notification(String title, String summary, ZonedDateTime dateTime)
      Constructs a new notification.
      Parameters:
      title - the title that will usually be shown in bold
      summary - a summary text of the noteworthy thing that happened
      dateTime - the date and time when the noteworthy thing happened
    • Notification

      public Notification(String title, String summary)
      Constructs a new notification.
      Parameters:
      title - the title that will usually be shown in bold
      summary - a summary text of the noteworthy thing that happened
  • Method Details

    • getGroup

      public final NotificationGroup getGroup()
      The group to which the notification belongs.
      Returns:
      the notification's parent
    • remove

      public final void remove()
      Convenience method to remove the notification from its group / its parent.
    • getTitle

      public final String getTitle()
      Gets the value of the property title.
      Property description:
      The title of the notification, e.g. "Purchase Order #123456" when this is the subject of an email for which the notification was created.
    • titleProperty

      public final javafx.beans.property.StringProperty titleProperty()
      The title of the notification, e.g. "Purchase Order #123456" when this is the subject of an email for which the notification was created.
      See Also:
    • setTitle

      public final void setTitle(String title)
      Sets the value of the property title.
      Property description:
      The title of the notification, e.g. "Purchase Order #123456" when this is the subject of an email for which the notification was created.
    • getSummary

      public final String getSummary()
      Gets the value of the property summary.
      Property description:
      A short summary of the noteworthy thing that happened.
    • summaryProperty

      public final javafx.beans.property.StringProperty summaryProperty()
      A short summary of the noteworthy thing that happened.
      See Also:
    • setSummary

      public final void setSummary(String summary)
      Sets the value of the property summary.
      Property description:
      A short summary of the noteworthy thing that happened.
    • getDateTime

      public final ZonedDateTime getDateTime()
      Gets the value of the property dateTime.
      Property description:
      The time stamp for this notification.
    • dateTimeProperty

      public final javafx.beans.property.ObjectProperty<ZonedDateTime> dateTimeProperty()
      The time stamp for this notification.
      See Also:
    • setDateTime

      public final void setDateTime(ZonedDateTime dateTime)
      Sets the value of the property dateTime.
      Property description:
      The time stamp for this notification.
    • getActions

      public final javafx.collections.ObservableList<NotificationAction> getActions()
      A list of (optional) actions that the user can perform directly from within the notification.
      Returns:
      a list of possible actions
    • getUserObject

      public final T getUserObject()
      Gets the value of the property userObject.
      Property description:
      An (optional) user object for easy linking between the notification and the business object for which the notification was created, e.g. an email or a calendar entry.
    • userObjectProperty

      public final javafx.beans.property.ObjectProperty<T> userObjectProperty()
      An (optional) user object for easy linking between the notification and the business object for which the notification was created, e.g. an email or a calendar entry.
      See Also:
    • setUserObject

      public final void setUserObject(T userObject)
      Sets the value of the property userObject.
      Property description:
      An (optional) user object for easy linking between the notification and the business object for which the notification was created, e.g. an email or a calendar entry.
    • isExpanded

      public final boolean isExpanded()
      Gets the value of the property expanded.
      Property description:
      A flag that gets updated when the notification's group was expanded or collapsed.
    • expandedProperty

      public final javafx.beans.property.BooleanProperty expandedProperty()
      A flag that gets updated when the notification's group was expanded or collapsed.
      See Also:
    • setExpanded

      public final void setExpanded(boolean expanded)
      Sets the value of the property expanded.
      Property description:
      A flag that gets updated when the notification's group was expanded or collapsed.
    • getOnClick

      public final javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour> getOnClick()
      Gets the value of the property onClick.
      Property description:
      A callback that determines how the notification and the view will behave when the user clicks on it. The default behaviour is to hide the view and remove the notification from its group.
    • onClickProperty

      public final javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour>> onClickProperty()
      A callback that determines how the notification and the view will behave when the user clicks on it. The default behaviour is to hide the view and remove the notification from its group.
      See Also:
    • setOnClick

      public final void setOnClick(javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour> onClick)
      Sets the value of the property onClick.
      Property description:
      A callback that determines how the notification and the view will behave when the user clicks on it. The default behaviour is to hide the view and remove the notification from its group.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Notification<T> o)
      Specified by:
      compareTo in interface Comparable<T>