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

public Class NotificationGroup<T, S extends Notification<T>>

extends Object
implements Comparable<NotificationGroup<T, S extends Notification<T>>>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Type Parameters
<T>
the type of the business / user objects
<S>
the type of the notifications
Imports
javafx.beans.property.BooleanProperty, .IntegerProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleIntegerProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.collections.FXCollections, .ListChangeListener, .ObservableList, javafx.util.Callback, java.util.Objects

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.

Field Summary

Modifier and TypeField and Description
private final BooleanProperty
private final BooleanProperty
private final IntegerProperty
private final StringProperty
private final ObservableList<S>
public final BooleanProperty
public final BooleanProperty
public final BooleanProperty
private final IntegerProperty
private final ObjectProperty<Callback<S, NotificationView<T, S>>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final BooleanProperty

Returns:

true if the group automatically caollapses when less than two notifications are visible inside it.
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.

public int
compareTo(NotificationGroup<T, S extends Notification<T>> o)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public final BooleanProperty

Returns:

true if the group is expanded
expandedProperty
()

A flag used to signal whether the group should be shown expanded or stacked.

public final int
public final String
public final ObservableList<S>

Returns:

the list of notifications
getNotifications
()

The list of notifications in the group.

public final Integer
public final Callback<S, NotificationView<T, S>>
public final boolean
public final boolean
public final boolean
public final boolean
public final boolean
public final IntegerProperty

Returns:

the maximum number of notifications to show in the standard layout
maximumNumberOfNotificationsProperty
()

A number that determines how many notifications can be shown in the group before the "show all" button will be accessible.

public final StringProperty

Returns:

the name of the group
nameProperty
()

The group's name.

public final BooleanProperty

Returns:

true if the group can be pinned
pinnableProperty
()

Determines whether the user is allowed to pin the group so that is always stays visible at the top of the info center.

public final BooleanProperty

Returns:

true if the group is pinned
pinnedProperty
()

Pinned groups will always be shown at the top of the info center.

public final void
setAutoCollapse(boolean autoCollapse)

public final void
setExpanded(boolean expanded)

public final void
setMaximumNumberOfNotifications(int maximumNumberOfNotifications)

public final void
public final void
setPinnable(boolean pinnable)

public final void
setPinned(boolean pinned)

public final void
setShowHeader(boolean showHeader)

public final void
setSortOrder(Integer sortOrder)

public final void
setViewFactory(Callback<S, NotificationView<T, S>> viewFactory)

public final BooleanProperty

Returns:

true if the group will show its header
showHeaderProperty
()

Determines if this group will show its name and controls when in expanded state.

public final IntegerProperty

Returns:

the sort order
sortOrderProperty
()

An (optional) value for the sort order.

public final ObjectProperty<Callback<S, NotificationView<T, S>>>

Returns:

the view factory callback
viewFactoryProperty
()

A callback used to create the NotificationView instances for the info center.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoCollapseback to summary
private final BooleanProperty autoCollapse
expandedback to summary
private final BooleanProperty expanded
maximumNumberOfNotificationsback to summary
private final IntegerProperty maximumNumberOfNotifications
nameback to summary
private final StringProperty name
notificationsback to summary
private final ObservableList<S> notifications
pinnableback to summary
public final BooleanProperty pinnable
pinnedback to summary
public final BooleanProperty pinned
showHeaderback to summary
public final BooleanProperty showHeader
sortOrderback to summary
private final IntegerProperty sortOrder
viewFactoryback to summary
private final ObjectProperty<Callback<S, NotificationView<T, S>>> viewFactory

Constructor Detail

NotificationGroupback to summary
public NotificationGroup(String name)

Method Detail

autoCollapsePropertyback to summary
public final 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:BooleanProperty

true if the group automatically caollapses when less than two notifications are visible inside it.

compareToback to summary
public int compareTo(NotificationGroup<T, S extends 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
expandedPropertyback to summary
public final BooleanProperty expandedProperty()

A flag used to signal whether the group should be shown expanded or stacked.

Returns:BooleanProperty

true if the group is expanded

getMaximumNumberOfNotificationsback to summary
public final int getMaximumNumberOfNotifications()
getNameback to summary
public final String getName()
getNotificationsback to summary
public final ObservableList<S> getNotifications()

The list of notifications in the group.

Returns:ObservableList<S>

the list of notifications

getSortOrderback to summary
public final Integer getSortOrder()
getViewFactoryback to summary
public final Callback<S, NotificationView<T, S>> getViewFactory()
isAutoCollapseback to summary
public final boolean isAutoCollapse()
isExpandedback to summary
public final boolean isExpanded()
isPinnableback to summary
public final boolean isPinnable()
isPinnedback to summary
public final boolean isPinned()
isShowHeaderback to summary
public final boolean isShowHeader()
maximumNumberOfNotificationsPropertyback to summary
public final 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 a javafx.scene.control.ListView.

Returns:IntegerProperty

the maximum number of notifications to show in the standard layout

namePropertyback to summary
public final StringProperty nameProperty()

The group's name.

Returns:StringProperty

the name of the group

pinnablePropertyback to summary
public final 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:BooleanProperty

true if the group can be pinned

pinnedPropertyback to summary
public final 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:BooleanProperty

true if the group is pinned

setAutoCollapseback to summary
public final void setAutoCollapse(boolean autoCollapse)
setExpandedback to summary
public final void setExpanded(boolean expanded)
setMaximumNumberOfNotificationsback to summary
public final void setMaximumNumberOfNotifications(int maximumNumberOfNotifications)
setNameback to summary
public final void setName(String name)
setPinnableback to summary
public final void setPinnable(boolean pinnable)
setPinnedback to summary
public final void setPinned(boolean pinned)
setShowHeaderback to summary
public final void setShowHeader(boolean showHeader)
setSortOrderback to summary
public final void setSortOrder(Integer sortOrder)
setViewFactoryback to summary
public final void setViewFactory(Callback<S, NotificationView<T, S>> viewFactory)
showHeaderPropertyback to summary
public final BooleanProperty showHeaderProperty()

Determines if this group will show its name and controls when in expanded state. Default is true.

Returns:BooleanProperty

true if the group will show its header

sortOrderPropertyback to summary
public final 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:IntegerProperty

the sort order

viewFactoryPropertyback to summary
public final ObjectProperty<Callback<S, NotificationView<T, S>>> viewFactoryProperty()

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:ObjectProperty<Callback<S, NotificationView<T, S>>>

the view factory callback