SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.service.ui.ToasterService Class Reference

A centralized service for sending toast notifications to the UI. More...

+ Collaboration diagram for fr.softsf.sudokufx.service.ui.ToasterService:

Public Member Functions

ReadOnlyBooleanProperty removeToastRequestProperty ()
 Returns a read-only observable property that signals requests to remove a toast.
 
void requestRemoveToast ()
 Requests the removal of the currently displayed toast.
 
void showError (String visibleText, String detailedText) throws NullPointerException
 Sends an error toast.
 
void showInfo (String visibleText, String detailedText) throws NullPointerException
 Sends an informational toast.
 
void showWarning (String visibleText, String detailedText) throws NullPointerException
 Sends a warning toast.
 
ReadOnlyObjectProperty< ToastData > toastRequestProperty ()
 Returns a read-only observable property for toast notifications.
 

Private Member Functions

void sendToast (String visibleText, String detailedText, ToastLevels level)
 Publishes a ToastData to toastRequest, resetting it to null first to ensure listeners fire even if identical to the previous value.
 

Private Attributes

final BooleanProperty removeToastRequest = new SimpleBooleanProperty(false)
 
final ObjectProperty< ToastData > toastRequest = new SimpleObjectProperty<>()
 

Detailed Description

A centralized service for sending toast notifications to the UI.

ViewModels can inject this service to trigger toasts.

Member Function Documentation

◆ removeToastRequestProperty()

ReadOnlyBooleanProperty fr.softsf.sudokufx.service.ui.ToasterService.removeToastRequestProperty ( )

Returns a read-only observable property that signals requests to remove a toast.

◆ requestRemoveToast()

void fr.softsf.sudokufx.service.ui.ToasterService.requestRemoveToast ( )

Requests the removal of the currently displayed toast.

This triggers the removeToastRequestProperty() listener in the UI to remove the toast.

◆ sendToast()

void fr.softsf.sudokufx.service.ui.ToasterService.sendToast ( String visibleText,
String detailedText,
ToastLevels level )
private

Publishes a ToastData to toastRequest, resetting it to null first to ensure listeners fire even if identical to the previous value.

Parameters
visibleTextThe text displayed in the toast
detailedTextThe detailed text for clipboard copy
levelThe severity level of the toast
Exceptions
NullPointerExceptionif visibleText or detailedText is null

◆ showError()

void fr.softsf.sudokufx.service.ui.ToasterService.showError ( String visibleText,
String detailedText ) throws NullPointerException

Sends an error toast.

Exceptions
NullPointerExceptionif visibleText or detailedText is null
+ Here is the call graph for this function:

◆ showInfo()

void fr.softsf.sudokufx.service.ui.ToasterService.showInfo ( String visibleText,
String detailedText ) throws NullPointerException

Sends an informational toast.

Exceptions
NullPointerExceptionif visibleText or detailedText is null
+ Here is the call graph for this function:

◆ showWarning()

void fr.softsf.sudokufx.service.ui.ToasterService.showWarning ( String visibleText,
String detailedText ) throws NullPointerException

Sends a warning toast.

Exceptions
NullPointerExceptionif visibleText or detailedText is null
+ Here is the call graph for this function:

◆ toastRequestProperty()

ReadOnlyObjectProperty< ToastData > fr.softsf.sudokufx.service.ui.ToasterService.toastRequestProperty ( )

Returns a read-only observable property for toast notifications.

Member Data Documentation

◆ removeToastRequest

final BooleanProperty fr.softsf.sudokufx.service.ui.ToasterService.removeToastRequest = new SimpleBooleanProperty(false)
private

◆ toastRequest

final ObjectProperty<ToastData> fr.softsf.sudokufx.service.ui.ToasterService.toastRequest = new SimpleObjectProperty<>()
private

The documentation for this class was generated from the following file: