- 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 Summary
PropertiesTypePropertyDescriptionSpecifies the notification's read state. -
Method Summary
Modifier and TypeMethodDescriptionlonggetState()longgetTime()Specifies the notification's read state.voidSets the value of the property notificationState.voidsetOnUpdateElapsed(BiConsumer<Long, String> elapsedConsumer) This action is automatically called byupdateElapsed(), use this to inform "someone" that the elapsed time should be updated.voidsetTimeToStringConverter(Function<Long, String> converter) Sets the function used to convert a time in seconds to String.voidShould be called by a periodic task to inform "someone" that the elapsed time should be updated
-
Property Details
-
notificationState
ObjectProperty<NotificationState> notificationStatePropertySpecifies the notification's read state.- See Also:
-
-
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
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
- Returns:
- the function used to convert a time in seconds to String
-
setTimeToStringConverter
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
This action is automatically called byupdateElapsed(), use this to inform "someone" that the elapsed time should be updated. The action is aBiConsumerand the inputs are the elapsed seconds as a long value and the elapsed seconds converted to a String by using thegetTimeToStringConverter().
-