Module com.dlsc.gemsfx
Package com.dlsc.gemsfx.infocenter
Class NotificationGroup<T,S extends Notification<T>>
java.lang.Object
com.dlsc.gemsfx.infocenter.NotificationGroup<T,S>
- Type Parameters:
T
- the type of the business / user objectsS
- the type of the notifications
- All Implemented Interfaces:
Comparable<NotificationGroup>
public class NotificationGroup<T,S extends Notification<T>>
extends Object
implements Comparable<NotificationGroup>
The model object used to group a list of notifications. Each group can hold notifications of
a specific type. Each group also has its own view factory for notifications so that different
groups can display notifications in different ways.
-
Property Summary
TypePropertyDescriptionfinal javafx.beans.property.BooleanProperty
A flag used to control whether the group will automatically change to "collapsed" state once the group is down to less than two notifications.final javafx.beans.property.BooleanProperty
A flag used to signal whether the group should be shown expanded or stacked.final javafx.beans.property.IntegerProperty
A number that determines how many notifications can be shown in the group before the "show all" button will be accessible.final javafx.beans.property.StringProperty
The group's name.final javafx.beans.property.BooleanProperty
Determines whether the user is allowed to pin the group so that is always stays visible at the top of the info center.final javafx.beans.property.BooleanProperty
Pinned groups will always be shown at the top of the info center.final javafx.beans.property.BooleanProperty
Determines if this group will show its name and controls when in expanded state.final javafx.beans.property.IntegerProperty
An (optional) value for the sort order.final javafx.beans.property.ObjectProperty<javafx.util.Callback<S,
NotificationView<T, S>>> A callback used to create theNotificationView
instances for the info center. -
Field Summary
Modifier and TypeFieldDescriptionfinal javafx.beans.property.BooleanProperty
final javafx.beans.property.BooleanProperty
final javafx.beans.property.BooleanProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.beans.property.BooleanProperty
A flag used to control whether the group will automatically change to "collapsed" state once the group is down to less than two notifications.int
final javafx.beans.property.BooleanProperty
A flag used to signal whether the group should be shown expanded or stacked.final int
Gets the value of themaximumNumberOfNotifications
property.final String
getName()
Gets the value of thename
property.final javafx.collections.ObservableList<S>
The list of notifications in the group.final Integer
Gets the value of thesortOrder
property.final javafx.util.Callback<S,
NotificationView<T, S>> Gets the value of theviewFactory
property.final boolean
Gets the value of theautoCollapse
property.final boolean
Gets the value of theexpanded
property.final boolean
Gets the value of thepinnable
property.final boolean
isPinned()
Gets the value of thepinned
property.final boolean
Gets the value of theshowHeader
property.final javafx.beans.property.IntegerProperty
A number that determines how many notifications can be shown in the group before the "show all" button will be accessible.final javafx.beans.property.StringProperty
The group's name.final javafx.beans.property.BooleanProperty
Determines whether the user is allowed to pin the group so that is always stays visible at the top of the info center.final javafx.beans.property.BooleanProperty
Pinned groups will always be shown at the top of the info center.final void
setAutoCollapse
(boolean autoCollapse) Sets the value of theautoCollapse
property.final void
setExpanded
(boolean expanded) Sets the value of theexpanded
property.final void
setMaximumNumberOfNotifications
(int maximumNumberOfNotifications) Sets the value of themaximumNumberOfNotifications
property.final void
Sets the value of thename
property.final void
setPinnable
(boolean pinnable) Sets the value of thepinnable
property.final void
setPinned
(boolean pinned) Sets the value of thepinned
property.final void
setShowHeader
(boolean showHeader) Sets the value of theshowHeader
property.final void
setSortOrder
(Integer sortOrder) Sets the value of thesortOrder
property.final void
setViewFactory
(javafx.util.Callback<S, NotificationView<T, S>> viewFactory) Sets the value of theviewFactory
property.final javafx.beans.property.BooleanProperty
Determines if this group will show its name and controls when in expanded state.final javafx.beans.property.IntegerProperty
An (optional) value for the sort order.final javafx.beans.property.ObjectProperty<javafx.util.Callback<S,
NotificationView<T, S>>> A callback used to create theNotificationView
instances for the info center.
-
Property Details
-
name
public final javafx.beans.property.StringProperty namePropertyThe group's name.- See Also:
-
sortOrder
public final javafx.beans.property.IntegerProperty sortOrderPropertyAn (optional) value for the sort order. Can be used to influence the order in which the groups are showing up in the info center. The value can be null. -
expanded
public final javafx.beans.property.BooleanProperty expandedPropertyA flag used to signal whether the group should be shown expanded or stacked. -
showHeader
public final javafx.beans.property.BooleanProperty showHeaderPropertyDetermines if this group will show its name and controls when in expanded state. Default is true. -
pinnable
public final javafx.beans.property.BooleanProperty pinnablePropertyDetermines whether the user is allowed to pin the group so that is always stays visible at the top of the info center. -
pinned
public final javafx.beans.property.BooleanProperty pinnedPropertyPinned groups will always be shown at the top of the info center. They can not be scrolled out of the visible area.- See Also:
-
viewFactory
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<S extends Notification<T>,NotificationView<T, viewFactoryPropertyS extends Notification<T>>>> A callback used to create theNotificationView
instances for the info center. Each group can have its own factory and customize the notification views. -
maximumNumberOfNotifications
public final javafx.beans.property.IntegerProperty maximumNumberOfNotificationsPropertyA number that determines how many notifications can be shown in the group before the "show all" button will be accessible. When the user presses this button the info center will switch to a different layout and display only this group's notifications inside aListView
. -
autoCollapse
public final javafx.beans.property.BooleanProperty autoCollapsePropertyA flag used to control whether the group will automatically change to "collapsed" state once the group is down to less than two notifications. This behaviour is application-specific and some might choose to always keep the last expansion state, some might prefer to always return to a collapsed state to avoid clutter in the UI.
-
-
Field Details
-
showHeader
public final javafx.beans.property.BooleanProperty showHeader -
pinnable
public final javafx.beans.property.BooleanProperty pinnable -
pinned
public final javafx.beans.property.BooleanProperty pinned
-
-
Constructor Details
-
NotificationGroup
-
-
Method Details
-
getName
Gets the value of thename
property.- Property description:
- The group's name.
- Returns:
- the value of the
name
property - See Also:
-
nameProperty
public final javafx.beans.property.StringProperty nameProperty()The group's name.- Returns:
- the name of the group
- See Also:
-
setName
Sets the value of thename
property.- Property description:
- The group's name.
- Parameters:
name
- the value for thename
property- See Also:
-
getSortOrder
Gets the value of thesortOrder
property.- Property description:
- An (optional) value for the sort order. Can be used to influence the order in which the groups are showing up in the info center. The value can be null.
- Returns:
- the value of the
sortOrder
property - See Also:
-
sortOrderProperty
public final javafx.beans.property.IntegerProperty sortOrderProperty()An (optional) value for the sort order. Can be used to influence the order in which the groups are showing up in the info center. The value can be null.- Returns:
- the sort order
- See Also:
-
setSortOrder
Sets the value of thesortOrder
property.- Property description:
- An (optional) value for the sort order. Can be used to influence the order in which the groups are showing up in the info center. The value can be null.
- Parameters:
sortOrder
- the value for thesortOrder
property- See Also:
-
getNotifications
The list of notifications in the group.- Returns:
- the list of notifications
-
isExpanded
public final boolean isExpanded()Gets the value of theexpanded
property.- Property description:
- A flag used to signal whether the group should be shown expanded or stacked.
- Returns:
- the value of the
expanded
property - See Also:
-
expandedProperty
public final javafx.beans.property.BooleanProperty expandedProperty()A flag used to signal whether the group should be shown expanded or stacked.- Returns:
- true if the group is expanded
- See Also:
-
setExpanded
public final void setExpanded(boolean expanded) Sets the value of theexpanded
property.- Property description:
- A flag used to signal whether the group should be shown expanded or stacked.
- Parameters:
expanded
- the value for theexpanded
property- See Also:
-
isShowHeader
public final boolean isShowHeader()Gets the value of theshowHeader
property.- Property description:
- Determines if this group will show its name and controls when in expanded state. Default is true.
- Returns:
- the value of the
showHeader
property - See Also:
-
showHeaderProperty
public final javafx.beans.property.BooleanProperty showHeaderProperty()Determines if this group will show its name and controls when in expanded state. Default is true.- Returns:
- true if the group will show its header
- See Also:
-
setShowHeader
public final void setShowHeader(boolean showHeader) Sets the value of theshowHeader
property.- Property description:
- Determines if this group will show its name and controls when in expanded state. Default is true.
- Parameters:
showHeader
- the value for theshowHeader
property- See Also:
-
isPinnable
public final boolean isPinnable()Gets the value of thepinnable
property.- Property description:
- Determines whether the user is allowed to pin the group so that is always stays visible at the top of the info center.
- Returns:
- the value of the
pinnable
property - See Also:
-
pinnableProperty
public final javafx.beans.property.BooleanProperty pinnableProperty()Determines whether the user is allowed to pin the group so that is always stays visible at the top of the info center.- Returns:
- true if the group can be pinned
- See Also:
-
setPinnable
public final void setPinnable(boolean pinnable) Sets the value of thepinnable
property.- Property description:
- Determines whether the user is allowed to pin the group so that is always stays visible at the top of the info center.
- Parameters:
pinnable
- the value for thepinnable
property- See Also:
-
isPinned
public final boolean isPinned()Gets the value of thepinned
property.- Property description:
- Pinned groups will always be shown at the top of the info center. They can not be scrolled out of the visible area.
- Returns:
- the value of the
pinned
property - See Also:
-
pinnedProperty
public final javafx.beans.property.BooleanProperty pinnedProperty()Pinned groups will always be shown at the top of the info center. They can not be scrolled out of the visible area.- Returns:
- true if the group is pinned
- See Also:
-
setPinned
public final void setPinned(boolean pinned) Sets the value of thepinned
property.- Property description:
- Pinned groups will always be shown at the top of the info center. They can not be scrolled out of the visible area.
- Parameters:
pinned
- the value for thepinned
property- See Also:
-
getViewFactory
Gets the value of theviewFactory
property.- Property description:
- A callback used to create the
NotificationView
instances for the info center. Each group can have its own factory and customize the notification views. - Returns:
- the value of the
viewFactory
property - See Also:
-
viewFactoryProperty
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<S,NotificationView<T, viewFactoryProperty()S>>> A callback used to create theNotificationView
instances for the info center. Each group can have its own factory and customize the notification views.- Returns:
- the view factory callback
- See Also:
-
setViewFactory
Sets the value of theviewFactory
property.- Property description:
- A callback used to create the
NotificationView
instances for the info center. Each group can have its own factory and customize the notification views. - Parameters:
viewFactory
- the value for theviewFactory
property- See Also:
-
getMaximumNumberOfNotifications
public final int getMaximumNumberOfNotifications()Gets the value of themaximumNumberOfNotifications
property.- Property description:
- A number that determines how many notifications can be shown in the group before the
"show all" button will be accessible. When the user presses this button the info center
will switch to a different layout and display only this group's notifications inside
a
ListView
. - Returns:
- the value of the
maximumNumberOfNotifications
property - See Also:
-
maximumNumberOfNotificationsProperty
public final javafx.beans.property.IntegerProperty maximumNumberOfNotificationsProperty()A number that determines how many notifications can be shown in the group before the "show all" button will be accessible. When the user presses this button the info center will switch to a different layout and display only this group's notifications inside aListView
.- Returns:
- the maximum number of notifications to show in the standard layout
- See Also:
-
setMaximumNumberOfNotifications
public final void setMaximumNumberOfNotifications(int maximumNumberOfNotifications) Sets the value of themaximumNumberOfNotifications
property.- Property description:
- A number that determines how many notifications can be shown in the group before the
"show all" button will be accessible. When the user presses this button the info center
will switch to a different layout and display only this group's notifications inside
a
ListView
. - Parameters:
maximumNumberOfNotifications
- the value for themaximumNumberOfNotifications
property- See Also:
-
isAutoCollapse
public final boolean isAutoCollapse()Gets the value of theautoCollapse
property.- Property description:
- A flag used to control whether the group will automatically change to "collapsed" state once the group is down to less than two notifications. This behaviour is application-specific and some might choose to always keep the last expansion state, some might prefer to always return to a collapsed state to avoid clutter in the UI.
- Returns:
- the value of the
autoCollapse
property - See Also:
-
autoCollapseProperty
public final javafx.beans.property.BooleanProperty autoCollapseProperty()A flag used to control whether the group will automatically change to "collapsed" state once the group is down to less than two notifications. This behaviour is application-specific and some might choose to always keep the last expansion state, some might prefer to always return to a collapsed state to avoid clutter in the UI.- Returns:
- true if the group automatically caollapses when less than two notifications are visible inside it.
- See Also:
-
setAutoCollapse
public final void setAutoCollapse(boolean autoCollapse) Sets the value of theautoCollapse
property.- Property description:
- A flag used to control whether the group will automatically change to "collapsed" state once the group is down to less than two notifications. This behaviour is application-specific and some might choose to always keep the last expansion state, some might prefer to always return to a collapsed state to avoid clutter in the UI.
- Parameters:
autoCollapse
- the value for theautoCollapse
property- See Also:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T>
-