java.lang.Object
com.dlsc.gemsfx.infocenter.Notification<T>
- Type Parameters:
T- the type of the user object
- All Implemented Interfaces:
Comparable<Notification<T>>
- Direct Known Subclasses:
InfoCenterApp.CalendarNotification,InfoCenterApp.MailNotification,InfoCenterApp.SlackNotification
A pure model object containing the data for a
NotificationView.
Notifications can be added to groups (NotificationGroup).- See Also:
-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.ObjectProperty<ZonedDateTime>The time stamp for this notification.final javafx.beans.property.BooleanPropertyA flag that gets updated when the notification's group was expanded or collapsed.final javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour>> A callback that determines how the notification and the view will behave when the user clicks on it.final javafx.beans.property.StringPropertyA short summary of the noteworthy thing that happened.final javafx.beans.property.StringPropertyThe title of the notification, e.g.final javafx.beans.property.ObjectProperty<T>An (optional) user object for easy linking between the notification and the business object for which the notification was created, e.g. -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA list of possible behaviours that are supported when the user clicks on a notification. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour>> -
Constructor Summary
ConstructorsConstructorDescriptionNotification(String title, String summary) Constructs a new notification.Notification(String title, String summary, ZonedDateTime dateTime) Constructs a new notification. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(Notification<T> o) final javafx.beans.property.ObjectProperty<ZonedDateTime>The time stamp for this notification.final javafx.beans.property.BooleanPropertyA flag that gets updated when the notification's group was expanded or collapsed.final javafx.collections.ObservableList<NotificationAction>A list of (optional) actions that the user can perform directly from within the notification.final ZonedDateTimeGets the value of thedateTimeproperty.final NotificationGroupgetGroup()The group to which the notification belongs.final javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour> Gets the value of theonClickproperty.final StringGets the value of thesummaryproperty.final StringgetTitle()Gets the value of thetitleproperty.final TGets the value of theuserObjectproperty.final booleanGets the value of theexpandedproperty.final javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour>> A callback that determines how the notification and the view will behave when the user clicks on it.final voidremove()Convenience method to remove the notification from its group / its parent.final voidsetDateTime(ZonedDateTime dateTime) Sets the value of thedateTimeproperty.final voidsetExpanded(boolean expanded) Sets the value of theexpandedproperty.final voidsetOnClick(javafx.util.Callback<Notification<T>, Notification.OnClickBehaviour> onClick) Sets the value of theonClickproperty.final voidsetSummary(String summary) Sets the value of thesummaryproperty.final voidSets the value of thetitleproperty.final voidsetUserObject(T userObject) Sets the value of theuserObjectproperty.final javafx.beans.property.StringPropertyA short summary of the noteworthy thing that happened.final javafx.beans.property.StringPropertyThe title of the notification, e.g.toString()final javafx.beans.property.ObjectProperty<T>An (optional) user object for easy linking between the notification and the business object for which the notification was created, e.g.
-
Property Details
-
title
public final javafx.beans.property.StringProperty titlePropertyThe 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 summaryPropertyA short summary of the noteworthy thing that happened.- See Also:
-
dateTime
The time stamp for this notification. -
userObject
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. -
expanded
public final javafx.beans.property.BooleanProperty expandedPropertyA flag that gets updated when the notification's group was expanded or collapsed. -
onClick
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour>> onClickPropertyA 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.
-
-
Field Details
-
onClick
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour>> onClick
-
-
Constructor Details
-
Notification
Constructs a new notification.- Parameters:
title- the title that will usually be shown in boldsummary- a summary text of the noteworthy thing that happeneddateTime- the date and time when the noteworthy thing happened
-
Notification
Constructs a new notification.- Parameters:
title- the title that will usually be shown in boldsummary- a summary text of the noteworthy thing that happened
-
-
Method Details
-
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
Gets the value of thetitleproperty.- 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.
- Returns:
- the value of the
titleproperty - See Also:
-
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.- Returns:
- the title of the notification
- See Also:
-
setTitle
Sets the value of thetitleproperty.- 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.
- Parameters:
title- the value for thetitleproperty- See Also:
-
getSummary
Gets the value of thesummaryproperty.- Property description:
- A short summary of the noteworthy thing that happened.
- Returns:
- the value of the
summaryproperty - See Also:
-
summaryProperty
public final javafx.beans.property.StringProperty summaryProperty()A short summary of the noteworthy thing that happened.- Returns:
- the summary text
- See Also:
-
setSummary
Sets the value of thesummaryproperty.- Property description:
- A short summary of the noteworthy thing that happened.
- Parameters:
summary- the value for thesummaryproperty- See Also:
-
getDateTime
Gets the value of thedateTimeproperty.- Property description:
- The time stamp for this notification.
- Returns:
- the value of the
dateTimeproperty - See Also:
-
dateTimeProperty
The time stamp for this notification.- Returns:
- the date and time
- See Also:
-
setDateTime
Sets the value of thedateTimeproperty.- Property description:
- The time stamp for this notification.
- Parameters:
dateTime- the value for thedateTimeproperty- See Also:
-
getActions
A list of (optional) actions that the user can perform directly from within the notification.- Returns:
- a list of possible actions
-
getUserObject
Gets the value of theuserObjectproperty.- 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.
- Returns:
- the value of the
userObjectproperty - See Also:
-
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.- Returns:
- the user object
- See Also:
-
setUserObject
Sets the value of theuserObjectproperty.- 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.
- Parameters:
userObject- the value for theuserObjectproperty- See Also:
-
isExpanded
public final boolean isExpanded()Gets the value of theexpandedproperty.- Property description:
- A flag that gets updated when the notification's group was expanded or collapsed.
- Returns:
- the value of the
expandedproperty - See Also:
-
expandedProperty
public final javafx.beans.property.BooleanProperty expandedProperty()A flag that gets updated when the notification's group was expanded or collapsed.- Returns:
- true if the notification's parent / group is currently expanded
- See Also:
-
setExpanded
public final void setExpanded(boolean expanded) Sets the value of theexpandedproperty.- Property description:
- A flag that gets updated when the notification's group was expanded or collapsed.
- Parameters:
expanded- the value for theexpandedproperty- See Also:
-
getOnClick
Gets the value of theonClickproperty.- 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.
- Returns:
- the value of the
onClickproperty - See Also:
-
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.- Returns:
- the behaviour upon click (do nothing, remove the notification, hide the view, ....)
- See Also:
-
setOnClick
public final void setOnClick(javafx.util.Callback<Notification<T>, Notification.OnClickBehaviour> onClick) Sets the value of theonClickproperty.- 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.
- Parameters:
onClick- the value for theonClickproperty- See Also:
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-