Module MaterialFX

Interface INotification

All Known Implementing Classes:
MFXSimpleNotification

public interface INotification
Interface which specifies the features of a notification rather than its content.

Base features of a notification are:

- the content, specified as a generic Region

- the read state property, NotificationState

- a way to tell when the notification was created, how much time has passed since creation, a way to convert the time from a long value to a String, a way to tell that the elapsed time should change and an action to run when this happens

  • Property Details

  • Method Details

    • getContent

      Region getContent()
      Returns:
      the notification's content
    • getState

      NotificationState getState()
    • notificationStateProperty

      ObjectProperty<NotificationState> notificationStateProperty()
      Specifies the notification's read state.
      See Also:
    • setNotificationState

      void setNotificationState(NotificationState state)
      Sets the value of the property notificationState.
      Property description:
      Specifies the notification's read state.
    • getTime

      long getTime()
      Returns:
      the created time as a long value, the number of seconds from the Java epoch
    • getElapsedTime

      long getElapsedTime()
      Returns:
      the difference between the current number of seconds from the Java epoch and the created time
    • getTimeToStringConverter

      Function<Long,String> getTimeToStringConverter()
      Returns:
      the function used to convert a time in seconds to String
    • setTimeToStringConverter

      void setTimeToStringConverter(Function<Long,String> converter)
      Sets the function used to convert a time in seconds to String.
    • updateElapsed

      void updateElapsed()
      Should be called by a periodic task to inform "someone" that the elapsed time should be updated
    • setOnUpdateElapsed

      void setOnUpdateElapsed(BiConsumer<Long,String> elapsedConsumer)
      This action is automatically called by updateElapsed(), use this to inform "someone" that the elapsed time should be updated. The action is a BiConsumer and the inputs are the elapsed seconds as a long value and the elapsed seconds converted to a String by using the getTimeToStringConverter().