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 objects
S - 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

    Properties
    Type
    Property
    Description
    final 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 the NotificationView instances for the info center.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final javafx.beans.property.BooleanProperty
     
    final javafx.beans.property.BooleanProperty
     
    final javafx.beans.property.BooleanProperty
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final 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 the maximumNumberOfNotifications property.
    final String
    Gets the value of the name property.
    final javafx.collections.ObservableList<S>
    The list of notifications in the group.
    final Integer
    Gets the value of the sortOrder property.
    final javafx.util.Callback<S,NotificationView<T,S>>
    Gets the value of the viewFactory property.
    final boolean
    Gets the value of the autoCollapse property.
    final boolean
    Gets the value of the expanded property.
    final boolean
    Gets the value of the pinnable property.
    final boolean
    Gets the value of the pinned property.
    final boolean
    Gets the value of the showHeader 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 the autoCollapse property.
    final void
    setExpanded(boolean expanded)
    Sets the value of the expanded property.
    final void
    setMaximumNumberOfNotifications(int maximumNumberOfNotifications)
    Sets the value of the maximumNumberOfNotifications property.
    final void
    Sets the value of the name property.
    final void
    setPinnable(boolean pinnable)
    Sets the value of the pinnable property.
    final void
    setPinned(boolean pinned)
    Sets the value of the pinned property.
    final void
    setShowHeader(boolean showHeader)
    Sets the value of the showHeader property.
    final void
    setSortOrder(Integer sortOrder)
    Sets the value of the sortOrder property.
    final void
    setViewFactory(javafx.util.Callback<S,NotificationView<T,S>> viewFactory)
    Sets the value of the viewFactory 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 the NotificationView instances for the info center.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Details

  • 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

      public NotificationGroup(String name)
  • Method Details

    • getName

      public final String getName()
      Gets the value of the name 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

      public final void setName(String name)
      Sets the value of the name property.
      Property description:
      The group's name.
      Parameters:
      name - the value for the name property
      See Also:
    • getSortOrder

      public final Integer getSortOrder()
      Gets the value of the sortOrder 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

      public final void setSortOrder(Integer sortOrder)
      Sets the value of the sortOrder 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 the sortOrder property
      See Also:
    • getNotifications

      public final javafx.collections.ObservableList<S> getNotifications()
      The list of notifications in the group.
      Returns:
      the list of notifications
    • isExpanded

      public final boolean isExpanded()
      Gets the value of the expanded 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 the expanded property.
      Property description:
      A flag used to signal whether the group should be shown expanded or stacked.
      Parameters:
      expanded - the value for the expanded property
      See Also:
    • isShowHeader

      public final boolean isShowHeader()
      Gets the value of the showHeader 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 the showHeader 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 the showHeader property
      See Also:
    • isPinnable

      public final boolean isPinnable()
      Gets the value of the pinnable 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 the pinnable 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 the pinnable property
      See Also:
    • isPinned

      public final boolean isPinned()
      Gets the value of the pinned 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 the pinned 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 the pinned property
      See Also:
    • getViewFactory

      public final javafx.util.Callback<S,NotificationView<T,S>> getViewFactory()
      Gets the value of the viewFactory 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,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:
      the view factory callback
      See Also:
    • setViewFactory

      public final void setViewFactory(javafx.util.Callback<S,NotificationView<T,S>> viewFactory)
      Sets the value of the viewFactory 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 the viewFactory property
      See Also:
    • getMaximumNumberOfNotifications

      public final int getMaximumNumberOfNotifications()
      Gets the value of the maximumNumberOfNotifications 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 a ListView.
      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 the maximumNumberOfNotifications 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 the maximumNumberOfNotifications property
      See Also:
    • isAutoCollapse

      public final boolean isAutoCollapse()
      Gets the value of the autoCollapse 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 the autoCollapse 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 the autoCollapse property
      See Also:
    • compareTo

      public int compareTo(NotificationGroup o)
      Specified by:
      compareTo in interface Comparable<T>