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)
 
BooleanProperty isOutOfDateProperty ()
 Indicates whether the application is out-of-date.
 
StringBinding maxiNewAccessibleTextProperty ()
 
StringBinding maxiNewTextProperty ()
 
StringBinding maxiNewTooltipProperty ()
 
StringBinding newAccessibleTextProperty ()
 
StringBinding newTooltipProperty ()
 
StringProperty 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 > currentTask
 
final BooleanProperty isOutOfDate = new SimpleBooleanProperty(false)
 
final StringBinding maxiNewAccessibleText
 
final StringBinding maxiNewText
 
final StringBinding maxiNewTooltip
 
final StringBinding newAccessibleText
 
final StringBinding newTooltip
 
final StringProperty statusMessage = new SimpleStringProperty()
 
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)
+ 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()

BooleanProperty 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 ( )

◆ maxiNewTextProperty()

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

◆ maxiNewTooltipProperty()

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

◆ newAccessibleTextProperty()

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

◆ newTooltipProperty()

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

◆ statusMessageProperty()

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

Provides the current status message from the version check.

Returns
a StringProperty with status messages

Member Data Documentation

◆ currentTask

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

◆ isOutOfDate

final BooleanProperty fr.softsf.sudokufx.viewmodel.MenuNewViewModel.isOutOfDate = new SimpleBooleanProperty(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 StringProperty fr.softsf.sudokufx.viewmodel.MenuNewViewModel.statusMessage = new SimpleStringProperty()
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: