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
TypePropertyDescriptionfinal javafx.beans.property.ObjectProperty<ZonedDateTime>
The time stamp for this notification.final javafx.beans.property.BooleanProperty
A 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.StringProperty
A short summary of the noteworthy thing that happened.final javafx.beans.property.StringProperty
The 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
Modifier and TypeClassDescriptionstatic enum
A list of possible behaviours that are supported when the user clicks on a notification. -
Field Summary
Modifier and TypeFieldDescriptionfinal javafx.beans.property.ObjectProperty<javafx.util.Callback<Notification<T>,
Notification.OnClickBehaviour>> -
Constructor Summary
ConstructorDescriptionNotification
(String title, String summary) Constructs a new notification.Notification
(String title, String summary, ZonedDateTime dateTime) Constructs a new notification. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(Notification<T> o) final javafx.beans.property.ObjectProperty<ZonedDateTime>
The time stamp for this notification.final javafx.beans.property.BooleanProperty
A 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 ZonedDateTime
Gets the value of thedateTime
property.final NotificationGroup
getGroup()
The group to which the notification belongs.final javafx.util.Callback<Notification<T>,
Notification.OnClickBehaviour> Gets the value of theonClick
property.final String
Gets the value of thesummary
property.final String
getTitle()
Gets the value of thetitle
property.final T
Gets the value of theuserObject
property.final boolean
Gets the value of theexpanded
property.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 void
remove()
Convenience method to remove the notification from its group / its parent.final void
setDateTime
(ZonedDateTime dateTime) Sets the value of thedateTime
property.final void
setExpanded
(boolean expanded) Sets the value of theexpanded
property.final void
setOnClick
(javafx.util.Callback<Notification<T>, Notification.OnClickBehaviour> onClick) Sets the value of theonClick
property.final void
setSummary
(String summary) Sets the value of thesummary
property.final void
Sets the value of thetitle
property.final void
setUserObject
(T userObject) Sets the value of theuserObject
property.final javafx.beans.property.StringProperty
A short summary of the noteworthy thing that happened.final javafx.beans.property.StringProperty
The 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 thetitle
property.- 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
title
property - 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 thetitle
property.- 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 thetitle
property- See Also:
-
getSummary
Gets the value of thesummary
property.- Property description:
- A short summary of the noteworthy thing that happened.
- Returns:
- the value of the
summary
property - 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 thesummary
property.- Property description:
- A short summary of the noteworthy thing that happened.
- Parameters:
summary
- the value for thesummary
property- See Also:
-
getDateTime
Gets the value of thedateTime
property.- Property description:
- The time stamp for this notification.
- Returns:
- the value of the
dateTime
property - See Also:
-
dateTimeProperty
The time stamp for this notification.- Returns:
- the date and time
- See Also:
-
setDateTime
Sets the value of thedateTime
property.- Property description:
- The time stamp for this notification.
- Parameters:
dateTime
- the value for thedateTime
property- 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 theuserObject
property.- 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
userObject
property - 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 theuserObject
property.- 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 theuserObject
property- See Also:
-
isExpanded
public final boolean isExpanded()Gets the value of theexpanded
property.- Property description:
- A flag that gets updated when the notification's group was expanded or collapsed.
- Returns:
- the value of the
expanded
property - 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 theexpanded
property.- Property description:
- A flag that gets updated when the notification's group was expanded or collapsed.
- Parameters:
expanded
- the value for theexpanded
property- See Also:
-
getOnClick
Gets the value of theonClick
property.- 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
onClick
property - 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 theonClick
property.- 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 theonClick
property- See Also:
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T>
-