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
PropertiesTypePropertyDescriptionfinal javafx.beans.property.BooleanPropertyA 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.BooleanPropertyA flag used to signal whether the group should be shown expanded or stacked.final javafx.beans.property.IntegerPropertyA number that determines how many notifications can be shown in the group before the "show all" button will be accessible.final javafx.beans.property.StringPropertyThe group's name.final javafx.beans.property.BooleanPropertyDetermines 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.BooleanPropertyPinned groups will always be shown at the top of the info center.final javafx.beans.property.BooleanPropertyDetermines if this group will show its name and controls when in expanded state.final javafx.beans.property.IntegerPropertyAn (optional) value for the sort order.final javafx.beans.property.ObjectProperty<javafx.util.Callback<S,NotificationView<T, S>>> A callback used to create theNotificationViewinstances for the info center. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal javafx.beans.property.BooleanPropertyfinal javafx.beans.property.BooleanPropertyfinal javafx.beans.property.BooleanProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.beans.property.BooleanPropertyA flag used to control whether the group will automatically change to "collapsed" state once the group is down to less than two notifications.intfinal javafx.beans.property.BooleanPropertyA flag used to signal whether the group should be shown expanded or stacked.final intGets the value of themaximumNumberOfNotificationsproperty.final StringgetName()Gets the value of thenameproperty.final javafx.collections.ObservableList<S>The list of notifications in the group.final IntegerGets the value of thesortOrderproperty.final javafx.util.Callback<S,NotificationView<T, S>> Gets the value of theviewFactoryproperty.final booleanGets the value of theautoCollapseproperty.final booleanGets the value of theexpandedproperty.final booleanGets the value of thepinnableproperty.final booleanisPinned()Gets the value of thepinnedproperty.final booleanGets the value of theshowHeaderproperty.final javafx.beans.property.IntegerPropertyA number that determines how many notifications can be shown in the group before the "show all" button will be accessible.final javafx.beans.property.StringPropertyThe group's name.final javafx.beans.property.BooleanPropertyDetermines 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.BooleanPropertyPinned groups will always be shown at the top of the info center.final voidsetAutoCollapse(boolean autoCollapse) Sets the value of theautoCollapseproperty.final voidsetExpanded(boolean expanded) Sets the value of theexpandedproperty.final voidsetMaximumNumberOfNotifications(int maximumNumberOfNotifications) Sets the value of themaximumNumberOfNotificationsproperty.final voidSets the value of thenameproperty.final voidsetPinnable(boolean pinnable) Sets the value of thepinnableproperty.final voidsetPinned(boolean pinned) Sets the value of thepinnedproperty.final voidsetShowHeader(boolean showHeader) Sets the value of theshowHeaderproperty.final voidsetSortOrder(Integer sortOrder) Sets the value of thesortOrderproperty.final voidsetViewFactory(javafx.util.Callback<S, NotificationView<T, S>> viewFactory) Sets the value of theviewFactoryproperty.final javafx.beans.property.BooleanPropertyDetermines if this group will show its name and controls when in expanded state.final javafx.beans.property.IntegerPropertyAn (optional) value for the sort order.final javafx.beans.property.ObjectProperty<javafx.util.Callback<S,NotificationView<T, S>>> A callback used to create theNotificationViewinstances 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 theNotificationViewinstances 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 thenameproperty.- Property description:
- The group's name.
- Returns:
- the value of the
nameproperty - 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 thenameproperty.- Property description:
- The group's name.
- Parameters:
name- the value for thenameproperty- See Also:
-
getSortOrder
Gets the value of thesortOrderproperty.- 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
sortOrderproperty - 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 thesortOrderproperty.- 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 thesortOrderproperty- See Also:
-
getNotifications
The list of notifications in the group.- Returns:
- the list of notifications
-
isExpanded
public final boolean isExpanded()Gets the value of theexpandedproperty.- Property description:
- A flag used to signal whether the group should be shown expanded or stacked.
- Returns:
- the value of the
expandedproperty - 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 theexpandedproperty.- Property description:
- A flag used to signal whether the group should be shown expanded or stacked.
- Parameters:
expanded- the value for theexpandedproperty- See Also:
-
isShowHeader
public final boolean isShowHeader()Gets the value of theshowHeaderproperty.- Property description:
- Determines if this group will show its name and controls when in expanded state. Default is true.
- Returns:
- the value of the
showHeaderproperty - 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 theshowHeaderproperty.- Property description:
- Determines if this group will show its name and controls when in expanded state. Default is true.
- Parameters:
showHeader- the value for theshowHeaderproperty- See Also:
-
isPinnable
public final boolean isPinnable()Gets the value of thepinnableproperty.- 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
pinnableproperty - 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 thepinnableproperty.- 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 thepinnableproperty- See Also:
-
isPinned
public final boolean isPinned()Gets the value of thepinnedproperty.- 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
pinnedproperty - 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 thepinnedproperty.- 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 thepinnedproperty- See Also:
-
getViewFactory
Gets the value of theviewFactoryproperty.- Property description:
- A callback used to create the
NotificationViewinstances for the info center. Each group can have its own factory and customize the notification views. - Returns:
- the value of the
viewFactoryproperty - See Also:
-
viewFactoryProperty
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<S,NotificationView<T, viewFactoryProperty()S>>> A callback used to create theNotificationViewinstances 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 theviewFactoryproperty.- Property description:
- A callback used to create the
NotificationViewinstances for the info center. Each group can have its own factory and customize the notification views. - Parameters:
viewFactory- the value for theviewFactoryproperty- See Also:
-
getMaximumNumberOfNotifications
public final int getMaximumNumberOfNotifications()Gets the value of themaximumNumberOfNotificationsproperty.- 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
maximumNumberOfNotificationsproperty - 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 themaximumNumberOfNotificationsproperty.- 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 themaximumNumberOfNotificationsproperty- See Also:
-
isAutoCollapse
public final boolean isAutoCollapse()Gets the value of theautoCollapseproperty.- 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
autoCollapseproperty - 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 theautoCollapseproperty.- 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 theautoCollapseproperty- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-