ViewModel for managing the "New" menu UI state, accessibility labels, and update status. More...
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 |
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.
| fr.softsf.sudokufx.viewmodel.MenuNewViewModel.MenuNewViewModel | ( | VersionService | versionService | ) |
Constructs a new MenuNewViewModel, initializes localized bindings, and triggers an asynchronous version check.
| versionService | the service used to verify application version status |
|
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.
|
private |
Creates a localized StringBinding for the given key.
Automatically updates when the locale changes.
| key | the localization key |
| 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.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewAccessibleTextProperty | ( | ) |
Returns the reactive binding for the maxi "New" button's accessible text.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewTextProperty | ( | ) |
Returns the reactive binding for the maxi "New" button's label text.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.maxiNewTooltipProperty | ( | ) |
Returns the reactive binding for the maxi "New" button's tooltip.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.newAccessibleTextProperty | ( | ) |
Returns the reactive binding for the maxi "New" button's tooltip.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuNewViewModel.newTooltipProperty | ( | ) |
Returns the reactive binding for the mini "New" button's tooltip.
| ReadOnlyStringProperty fr.softsf.sudokufx.viewmodel.MenuNewViewModel.statusMessageProperty | ( | ) |
Provides the current status message from the version check.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |