Top Description Inners Fields Constructors Methods
com.dlsc.gemsfx.infocenter

public Class Notification<T>

extends Object
implements Comparable<Notification<T>>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Type Parameters
<T>
the type of the user object
Imports
javafx.beans.property.BooleanProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.collections.FXCollections, .ObservableList, javafx.util.Callback, java.time.ZonedDateTime, java.util.Objects, .StringJoiner

A pure model object containing the data for a NotificationView. Notifications can be added to groups (NotificationGroup).
See Also
NotificationGroup#getNotifications()

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Notification.OnClickBehaviour

A list of possible behaviours that are supported when the user clicks on a notification.

public static enum

Field Summary

Modifier and TypeField and Description
private final ObservableList<NotificationAction<T>>
private final ObjectProperty<ZonedDateTime>
private final BooleanProperty
private NotificationGroup<T, S extends Notification<T>>
public final ObjectProperty<Callback<Notification<T>, Notification.OnClickBehaviour>>
private final StringProperty
private final StringProperty
private final ObjectProperty<Notification.Type>
private final ObjectProperty<T>

Constructor Summary

AccessConstructor and Description
public
Notification(String
the title that will usually be shown in bold
title
,
String
a summary text of the noteworthy thing that happened
summary
,
ZonedDateTime
the date and time when the noteworthy thing happened
dateTime
)

Constructs a new notification.

public
Notification(String
the title that will usually be shown in bold
title
,
String
a summary text of the noteworthy thing that happened
summary
)

Constructs a new notification.

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(Notification<T> o)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public final ObjectProperty<ZonedDateTime>

Returns:

the date and time
dateTimeProperty
()

The time stamp for this notification.

public final BooleanProperty

Returns:

true if the notification's parent / group is currently expanded
expandedProperty
()

A flag that gets updated when the notification's group was expanded or collapsed.

public final ObservableList<NotificationAction<T>>

Returns:

a list of possible actions
getActions
()

A list of (optional) actions that the user can perform directly from within the notification.

public final ZonedDateTime
public final NotificationGroup<T, S extends Notification<T>>

Returns:

the notification's parent
getGroup
()

The group to which the notification belongs.

public final Callback<Notification<T>, Notification.OnClickBehaviour>
public final String
public final String
public Notification.Type
public final T
public final boolean
public final ObjectProperty<Callback<Notification<T>, Notification.OnClickBehaviour>>

Returns:

the behaviour upon click (do nothing, remove the notification, hide the view, ....)
onClickProperty
()

A callback that determines how the notification and the view will behave when the user clicks on it.

public final void
remove()

Convenience method to remove the notification from its group / its parent.

public final void
public final void
setExpanded(boolean expanded)

pack-priv void
setGroup(NotificationGroup<T, S extends Notification<T>> group)

Package protected so that it can only be called from NotificationGroup.

public final void
public final void
setSummary(String summary)

public final void
public void
public final void
setUserObject(T userObject)

public final StringProperty

Returns:

the summary text
summaryProperty
()

A short summary of the noteworthy thing that happened.

public final StringProperty

Returns:

the title of the notification
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.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public ObjectProperty<Notification.Type>

Returns:

an ObjectProperty representing the type of the notification
typeProperty
()

Provides an object property containing the type of this notification.

public final ObjectProperty<T>

Returns:

the user object
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

actionsback to summary
private final ObservableList<NotificationAction<T>> actions
dateTimeback to summary
private final ObjectProperty<ZonedDateTime> dateTime
expandedback to summary
private final BooleanProperty expanded
groupback to summary
private NotificationGroup<T, S extends Notification<T>> group
onClickback to summary
public final ObjectProperty<Callback<Notification<T>, Notification.OnClickBehaviour>> onClick
summaryback to summary
private final StringProperty summary
titleback to summary
private final StringProperty title
typeback to summary
private final ObjectProperty<Notification.Type> type
userObjectback to summary
private final ObjectProperty<T> userObject

Constructor Detail

Notificationback to summary
public Notification(String title, String summary, ZonedDateTime dateTime)

Constructs a new notification.

Parameters
title:String

the title that will usually be shown in bold

summary:String

a summary text of the noteworthy thing that happened

dateTime:ZonedDateTime

the date and time when the noteworthy thing happened

Notificationback to summary
public Notification(String title, String summary)

Constructs a new notification.

Parameters
title:String

the title that will usually be shown in bold

summary:String

a summary text of the noteworthy thing that happened

Method Detail

compareToback to summary
public int compareTo(Notification<T> o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
dateTimePropertyback to summary
public final ObjectProperty<ZonedDateTime> dateTimeProperty()

The time stamp for this notification.

Returns:ObjectProperty<ZonedDateTime>

the date and time

expandedPropertyback to summary
public final BooleanProperty expandedProperty()

A flag that gets updated when the notification's group was expanded or collapsed.

Returns:BooleanProperty

true if the notification's parent / group is currently expanded

getActionsback to summary
public final ObservableList<NotificationAction<T>> getActions()

A list of (optional) actions that the user can perform directly from within the notification.

Returns:ObservableList<NotificationAction<T>>

a list of possible actions

getDateTimeback to summary
public final ZonedDateTime getDateTime()
getGroupback to summary
public final NotificationGroup<T, S extends Notification<T>> getGroup()

The group to which the notification belongs.

Returns:NotificationGroup<T, S extends Notification<T>>

the notification's parent

getOnClickback to summary
public final Callback<Notification<T>, Notification.OnClickBehaviour> getOnClick()
getSummaryback to summary
public final String getSummary()
getTitleback to summary
public final String getTitle()
getTypeback to summary
public Notification.Type getType()
getUserObjectback to summary
public final T getUserObject()
isExpandedback to summary
public final boolean isExpanded()
onClickPropertyback to summary
public final ObjectProperty<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:ObjectProperty<Callback<Notification<T>, Notification.OnClickBehaviour>>

the behaviour upon click (do nothing, remove the notification, hide the view, ....)

removeback to summary
public final void remove()

Convenience method to remove the notification from its group / its parent.

setDateTimeback to summary
public final void setDateTime(ZonedDateTime dateTime)
setExpandedback to summary
public final void setExpanded(boolean expanded)
setGroupback to summary
pack-priv void setGroup(NotificationGroup<T, S extends Notification<T>> group)

Package protected so that it can only be called from NotificationGroup.

setOnClickback to summary
public final void setOnClick(Callback<Notification<T>, Notification.OnClickBehaviour> onClick)
setSummaryback to summary
public final void setSummary(String summary)
setTitleback to summary
public final void setTitle(String title)
setTypeback to summary
public void setType(Notification.Type type)
setUserObjectback to summary
public final void setUserObject(T userObject)
summaryPropertyback to summary
public final StringProperty summaryProperty()

A short summary of the noteworthy thing that happened.

Returns:StringProperty

the summary text

titlePropertyback to summary
public final 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:StringProperty

the title of the notification

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
typePropertyback to summary
public ObjectProperty<Notification.Type> typeProperty()

Provides an object property containing the type of this notification. The type represents the category or severity of the notification, such as INFO, WARNING, ERROR, or SUCCESS.

Returns:ObjectProperty<Notification.Type>

an ObjectProperty representing the type of the notification

userObjectPropertyback to summary
public final 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.

Returns:ObjectProperty<T>

the user object

com.dlsc.gemsfx.infocenter back to summary

public final Enum Notification.OnClickBehaviour

extends Enum<Notification.OnClickBehaviour>
Class Inheritance

A list of possible behaviours that are supported when the user clicks on a notification.

Field Summary

Modifier and TypeField and Description
public static final Notification.OnClickBehaviour
HIDE

Hide the parent view (the info center) when the user clicks on the notification.

public static final Notification.OnClickBehaviour
HIDE_AND_REMOVE

Hide the parent view and remove the notification from its group when the user clicks on it.

public static final Notification.OnClickBehaviour
NONE

Do nothing when the user clicks on the notification.

public static final Notification.OnClickBehaviour
REMOVE

Remove the notification from its group when the user clicks on it.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Notification.OnClickBehaviour
public static Notification.OnClickBehaviour[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

HIDEback to summary
public static final Notification.OnClickBehaviour HIDE

Hide the parent view (the info center) when the user clicks on the notification.

HIDE_AND_REMOVEback to summary
public static final Notification.OnClickBehaviour HIDE_AND_REMOVE

Hide the parent view and remove the notification from its group when the user clicks on it.

NONEback to summary
public static final Notification.OnClickBehaviour NONE

Do nothing when the user clicks on the notification.

REMOVEback to summary
public static final Notification.OnClickBehaviour REMOVE

Remove the notification from its group when the user clicks on it.

Constructor Detail

OnClickBehaviourback to summary
private OnClickBehaviour()

Method Detail

valueOfback to summary
public static Notification.OnClickBehaviour valueOf(String name)
valuesback to summary
public static Notification.OnClickBehaviour[] values()
com.dlsc.gemsfx.infocenter back to summary

public final Enum Notification.Type

extends Enum<Notification.Type>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Notification.Type
public static final Notification.Type
public static final Notification.Type
public static final Notification.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static Notification.Type
public static Notification.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ERRORback to summary
public static final Notification.Type ERROR
INFOback to summary
public static final Notification.Type INFO
SUCCESSback to summary
public static final Notification.Type SUCCESS
WARNINGback to summary
public static final Notification.Type WARNING

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static Notification.Type valueOf(String name)
valuesback to summary
public static Notification.Type[] values()