SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.viewmodel.MenuNewViewModel Class Reference

ViewModel for managing the "New" menu UI state, accessibility labels, and update status. More...

Collaboration diagram for fr.softsf.sudokufx.viewmodel.MenuNewViewModel:

Public Member Functions

 MenuNewViewModel (VersionService versionService)
 Constructs a new MenuNewViewModel, initializes localized bindings, and triggers an asynchronous version check.
ReadOnlyBooleanProperty isOutOfDateProperty ()
 Indicates whether the application is out-of-date.
StringBinding maxiNewAccessibleTextProperty ()
 Returns the reactive binding for the maxi "New" button's accessible text.
StringBinding maxiNewTextProperty ()
 Returns the reactive binding for the maxi "New" button's label text.
StringBinding maxiNewTooltipProperty ()
 Returns the reactive binding for the maxi "New" button's tooltip.
StringBinding newAccessibleTextProperty ()
 Returns the reactive binding for the maxi "New" button's tooltip.
StringBinding newTooltipProperty ()
 Returns the reactive binding for the mini "New" button's tooltip.
ReadOnlyStringProperty statusMessageProperty ()
 Provides the current status message from the version check.

Private Member Functions

void checkVersion ()
 Starts an async version check, updating isOutOfDate and statusMessage.
StringBinding createStringBinding (String key)
 Creates a localized StringBinding for the given key.

Private Attributes

Task< Boolean > checkVersionTask
final ReadOnlyBooleanWrapper isOutOfDate = new ReadOnlyBooleanWrapper(false)
final StringBinding maxiNewAccessibleText
final StringBinding maxiNewText
final StringBinding maxiNewTooltip
final StringBinding newAccessibleText
final StringBinding newTooltip
final ReadOnlyStringWrapper statusMessage = new ReadOnlyStringWrapper()
ChangeListener< Boolean > versionListener
final VersionService versionService

Detailed Description

ViewModel for managing the "New" menu UI state, accessibility labels, and update status.

Provides localized StringBindings for button texts, accessible texts, and tooltips for both maxi and mini "New" buttons.

Checks asynchronously via VersionService if the application is up-to-date, exposing update status and related messages to the view.

Uses the I18n singleton for localization with automatic updates on locale changes.

Constructor & Destructor Documentation

◆ MenuNewViewModel()

fr.softsf.sudokufx.viewmodel.MenuNewViewModel.MenuNewViewModel ( VersionService versionService)

Constructs a new MenuNewViewModel, initializes localized bindings, and triggers an asynchronous version check.

Parameters
versionServicethe service used to verify application version status
Here is the call graph for this function:

Member Function Documentation

◆ checkVersion()

void fr.softsf.sudokufx.viewmodel.MenuNewViewModel.checkVersion ( )
private

Starts an async version check, updating isOutOfDate and statusMessage.

Safely removes previous listeners and bindings to avoid memory leaks. Runs the check in a daemon thread.

◆ createStringBinding()

StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.createStringBinding ( String key)
private

Creates a localized StringBinding for the given key.

Automatically updates when the locale changes.

Parameters
keythe localization key
Returns
a StringBinding providing localized text

◆ isOutOfDateProperty()

ReadOnlyBooleanProperty fr.softsf.sudokufx.viewmodel.MenuNewViewModel.isOutOfDateProperty ( )

Indicates whether the application is out-of-date.

This property is useful for binding visibility of update notifications.

Returns
a BooleanProperty representing out-of-date status

◆ maxiNewAccessibleTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewAccessibleTextProperty ( )

Returns the reactive binding for the maxi "New" button's accessible text.

Returns
the StringBinding for the accessible text
Here is the call graph for this function:

◆ maxiNewTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewTextProperty ( )

Returns the reactive binding for the maxi "New" button's label text.

Returns
the StringBinding for the button text
Here is the call graph for this function:

◆ maxiNewTooltipProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewTooltipProperty ( )

Returns the reactive binding for the maxi "New" button's tooltip.

Returns
the StringBinding for the tooltip
Here is the call graph for this function:

◆ newAccessibleTextProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.newAccessibleTextProperty ( )

Returns the reactive binding for the maxi "New" button's tooltip.

Returns
the StringBinding for the tooltip
Here is the call graph for this function:

◆ newTooltipProperty()

StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.newTooltipProperty ( )

Returns the reactive binding for the mini "New" button's tooltip.

Returns
the StringBinding for the tooltip
Here is the call graph for this function:

◆ statusMessageProperty()

ReadOnlyStringProperty fr.softsf.sudokufx.viewmodel.MenuNewViewModel.statusMessageProperty ( )

Provides the current status message from the version check.

Returns
a StringProperty with status messages

Member Data Documentation

◆ checkVersionTask

Task<Boolean> fr.softsf.sudokufx.viewmodel.MenuNewViewModel.checkVersionTask
private

◆ isOutOfDate

final ReadOnlyBooleanWrapper fr.softsf.sudokufx.viewmodel.MenuNewViewModel.isOutOfDate = new ReadOnlyBooleanWrapper(false)
private

◆ maxiNewAccessibleText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewAccessibleText
private

◆ maxiNewText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewText
private

◆ maxiNewTooltip

final StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewTooltip
private

◆ newAccessibleText

final StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.newAccessibleText
private

◆ newTooltip

final StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.newTooltip
private

◆ statusMessage

final ReadOnlyStringWrapper fr.softsf.sudokufx.viewmodel.MenuNewViewModel.statusMessage = new ReadOnlyStringWrapper()
private

◆ versionListener

ChangeListener<Boolean> fr.softsf.sudokufx.viewmodel.MenuNewViewModel.versionListener
private

◆ versionService

final VersionService fr.softsf.sudokufx.viewmodel.MenuNewViewModel.versionService
private

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