ViewModel for managing backup menu UI state and accessibility texts. More...
Public Member Functions | |
| MenuSaveViewModel (PlayerStateHolder playerStateHolder, GameService gameService) | |
| Initializes the MenuSaveViewModel with necessary infrastructure and reactive bindings. | |
| StringBinding | backupAccessibleTextProperty () |
| Returns the reactive binding for the backup accessible text property. | |
| StringBinding | backupRoleDescriptionProperty () |
| Returns the reactive binding for the backup role description property. | |
| StringBinding | backupTextProperty () |
| Returns the reactive binding for the backup text property. | |
| StringBinding | backupTooltipProperty () |
| Returns the reactive binding for the backup tooltip property. | |
| StringBinding | cellConfirmationMessageProperty () |
| Returns the reactive binding for the cell confirmation message property. | |
| StringBinding | cellConfirmationTitleProperty () |
| Returns the reactive binding for the cell delete accessible text property. | |
| StringBinding | cellDeleteAccessibleTextProperty () |
| Returns the reactive binding for the cell delete accessible text property. | |
| void | createABackup () |
| Backup the player's game. | |
| void | deleteABackup (GameDto gameToDelete) |
| Deletes the specified game backup and refreshes the list. | |
| GameDto | getCurrentSelectedGameDto () |
| Retrieves the currently selected game for the active player. | |
| ObservableList< GameDto > | getGames () |
| Returns the observable list of games. | |
| StringBinding | maxiBackupAccessibleTextProperty () |
| Returns the reactive binding for the maxi backup accessible text property. | |
| StringBinding | maxiBackupRoleDescriptionProperty () |
| Returns the reactive binding for the maxi backup role description property. | |
| StringBinding | maxiBackupTextProperty () |
| Returns the reactive binding for the maxi backup text property. | |
| StringBinding | maxiBackupTooltipProperty () |
| Returns the reactive binding for the maxi backup tooltip property. | |
| StringBinding | reduceAccessibleTextProperty () |
| Returns the reactive binding for the reduce button accessible text property. | |
| StringBinding | reduceTextProperty () |
| Returns the reactive binding for the reduce button text property. | |
| StringBinding | reduceTooltipProperty () |
| Returns the reactive binding for the reduce button accessible text property. | |
| void | refreshGames () |
| Refreshes the game list and re-synchronizes the selected backup. | |
| void | restoreABackup (GameDto gameToRestore) |
| Restores a specific game backup. | |
| StringBinding | saveAccessibleTextProperty () |
| Returns the property for the currently selected backup. | |
| StringBinding | saveRoleDescriptionProperty () |
| Returns the reactive binding for the save tooltip property. | |
| StringBinding | saveTextProperty () |
| Returns the reactive binding for the save text property. | |
| StringBinding | saveTooltipProperty () |
| Returns the reactive binding for the save tooltip property. | |
| ObjectProperty< GameDto > | selectedBackupProperty () |
| Returns the property for the currently selected backup. | |
Private Member Functions | |
| StringBinding | createFormattedAndConcatenatedBinding (String key, String suffixKey) |
| Creates a localized StringBinding by concatenating the value of two keys. | |
| StringBinding | createStringBinding (String key) |
| Creates a simple localized StringBinding for the given key. | |
| void | loadGames () |
| Loads games into the observable list. | |
| void | setSelectedBackup () |
| Sets the selected backup to the one marked as selected, or defaults to the first in the list if none are selected. | |
Private Attributes | |
| final StringBinding | backupAccessibleText |
| final StringBinding | backupRoleDescription |
| final StringBinding | backupText |
| final StringBinding | backupTooltip |
| final StringBinding | cellConfirmationMessage |
| final StringBinding | cellConfirmationTitle |
| final StringBinding | cellDeleteAccessibleText |
| final ObservableList< GameDto > | games = FXCollections.observableArrayList() |
| final GameService | gameService |
| final StringBinding | maxiBackupAccessibleText |
| final StringBinding | maxiBackupRoleDescription |
| final StringBinding | maxiBackupText |
| final StringBinding | maxiBackupTooltip |
| final PlayerStateHolder | playerStateHolder |
| final StringBinding | reduceAccessibleText |
| final StringBinding | reduceText |
| final StringBinding | reduceTooltip |
| final StringBinding | saveAccessibleText |
| final StringBinding | saveRoleDescription |
| final StringBinding | saveText |
| final StringBinding | saveTooltip |
| final ObjectProperty< GameDto > | selectedBackup = new SimpleObjectProperty<>() |
Static Private Attributes | |
| static final String | MENU_ACCESSIBILITY_ROLE_DESCRIPTION_CLOSED |
| static final String | MENU_ACCESSIBILITY_ROLE_DESCRIPTION_OPENED |
ViewModel for managing backup menu UI state and accessibility texts.
Holds an observable list of saved games, the currently selected backup, and provides localized StringBindings for UI labels, accessibility, tooltips, and role descriptions.
Uses I18n singleton for localization with automatic updates on locale changes.
| fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.MenuSaveViewModel | ( | PlayerStateHolder | playerStateHolder, |
| GameService | gameService ) |
Initializes the MenuSaveViewModel with necessary infrastructure and reactive bindings.
Configures i18n-aware StringBindings for UI labels, tooltips, and accessibility roles. Triggers initial game list population.
| playerStateHolder | holder for persistent player state |
| gameService | service for game management operations |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupAccessibleTextProperty | ( | ) |
Returns the reactive binding for the backup accessible text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupRoleDescriptionProperty | ( | ) |
Returns the reactive binding for the backup role description property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupTextProperty | ( | ) |
Returns the reactive binding for the backup text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.backupTooltipProperty | ( | ) |
Returns the reactive binding for the backup tooltip property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellConfirmationMessageProperty | ( | ) |
Returns the reactive binding for the cell confirmation message property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellConfirmationTitleProperty | ( | ) |
Returns the reactive binding for the cell delete accessible text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.cellDeleteAccessibleTextProperty | ( | ) |
Returns the reactive binding for the cell delete accessible text property.
| void fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.createABackup | ( | ) |
Backup the player's game.
Creates a copy of the current game state and refreshes the player's game list.
| NullPointerException | if the current player or selected game is null. |
|
private |
Creates a localized StringBinding by concatenating the value of two keys.
Updates automatically when the locale changes.
| key | the base key |
| suffixKey | the key for the suffix to append |
|
private |
Creates a simple localized StringBinding for the given key.
Updates automatically when the locale changes.
| key | the i18n key |
| void fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.deleteABackup | ( | GameDto | gameToDelete | ) |
Deletes the specified game backup and refreshes the list.
| gameToDelete | game backup to be removed; must not be null |
| GameDto fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.getCurrentSelectedGameDto | ( | ) |
Retrieves the currently selected game for the active player.
GameDto | NullPointerException | if the player or their selected game is null |
| ObservableList< GameDto > fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.getGames | ( | ) |
Returns the observable list of games.
|
private |
Loads games into the observable list.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupAccessibleTextProperty | ( | ) |
Returns the reactive binding for the maxi backup accessible text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupRoleDescriptionProperty | ( | ) |
Returns the reactive binding for the maxi backup role description property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupTextProperty | ( | ) |
Returns the reactive binding for the maxi backup text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.maxiBackupTooltipProperty | ( | ) |
Returns the reactive binding for the maxi backup tooltip property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceAccessibleTextProperty | ( | ) |
Returns the reactive binding for the reduce button accessible text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceTextProperty | ( | ) |
Returns the reactive binding for the reduce button text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.reduceTooltipProperty | ( | ) |
Returns the reactive binding for the reduce button accessible text property.
| void fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.refreshGames | ( | ) |
Refreshes the game list and re-synchronizes the selected backup.
Used when the active player changes to update the UI state.
| void fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.restoreABackup | ( | GameDto | gameToRestore | ) |
Restores a specific game backup.
Switches the active selection to the provided game and refreshes the inventory.
| gameToRestore | the target game to restore; must not be null. |
| NullPointerException | if the current player's game context is missing. |
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveAccessibleTextProperty | ( | ) |
Returns the property for the currently selected backup.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveRoleDescriptionProperty | ( | ) |
Returns the reactive binding for the save tooltip property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveTextProperty | ( | ) |
Returns the reactive binding for the save text property.
| StringBinding fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.saveTooltipProperty | ( | ) |
Returns the reactive binding for the save tooltip property.
| ObjectProperty< GameDto > fr.softsf.sudokufx.viewmodel.MenuSaveViewModel.selectedBackupProperty | ( | ) |
Returns the property for the currently selected backup.
|
private |
Sets the selected backup to the one marked as selected, or defaults to the first in the list if none are selected.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |