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

ViewModel responsible for displaying the help dialog. More...

+ Collaboration diagram for fr.softsf.sudokufx.viewmodel.HelpViewModel:

Public Member Functions

 HelpViewModel (IOsFolder iOsFolder, Coordinator coordinator)
 Constructs the HelpViewModel with required dependencies.
 
void showHelp ()
 Shows the help dialog with application and system information.
 

Package Functions

void displayAlert (MyAlert alert)
 Displays the given alert and waits for user interaction.
 

Private Member Functions

void addLogFileButton (MyAlert informationAlert)
 Adds an "Open log file" button to the given alert.
 
void addWebsiteButton (MyAlert informationAlert)
 Adds a "Visit my website" button to the given alert.
 

Private Attributes

final Coordinator coordinator
 
final IOsFolder iOsFolder
 

Static Private Attributes

static final double ALERT_SIZE_RATIO = 0.6
 

Detailed Description

ViewModel responsible for displaying the help dialog.

It retrieves application and system information to show in an informational alert.

Constructor & Destructor Documentation

◆ HelpViewModel()

fr.softsf.sudokufx.viewmodel.HelpViewModel.HelpViewModel ( IOsFolder iOsFolder,
Coordinator coordinator )

Constructs the HelpViewModel with required dependencies.

Parameters
iOsFolderservice providing OS folder paths
coordinatornavigation coordinator for external actions

Member Function Documentation

◆ addLogFileButton()

void fr.softsf.sudokufx.viewmodel.HelpViewModel.addLogFileButton ( MyAlert informationAlert)
private

Adds an "Open log file" button to the given alert.

The button is aligned to the left and opens the system log file when clicked. The file path is resolved via iOsFolder.getOsLogsFolderPath() and validated beforehand.

Parameters
informationAlertthe alert to which the log file button will be added; must not be null
Exceptions
NullPointerExceptionif informationAlert is null or if the resolved file is null
IllegalArgumentExceptionif the resolved path is blank

◆ addWebsiteButton()

void fr.softsf.sudokufx.viewmodel.HelpViewModel.addWebsiteButton ( MyAlert informationAlert)
private

Adds a "Visit my website" button to the given alert.

The button is aligned to the left and opens my website page when clicked.

Parameters
informationAlertthe alert to which the website button will be added; must not be null
Exceptions
NullPointerExceptionif informationAlert is null

◆ displayAlert()

void fr.softsf.sudokufx.viewmodel.HelpViewModel.displayAlert ( MyAlert alert)
package

Displays the given alert and waits for user interaction.

Parameters
alertthe alert to display; must not be null
Exceptions
NullPointerExceptionif alert is null

◆ showHelp()

void fr.softsf.sudokufx.viewmodel.HelpViewModel.showHelp ( )

Shows the help dialog with application and system information.

Adds a "Become a sponsor!" button to the alert.

+ Here is the call graph for this function:

Member Data Documentation

◆ ALERT_SIZE_RATIO

final double fr.softsf.sudokufx.viewmodel.HelpViewModel.ALERT_SIZE_RATIO = 0.6
staticprivate

◆ coordinator

final Coordinator fr.softsf.sudokufx.viewmodel.HelpViewModel.coordinator
private

◆ iOsFolder

final IOsFolder fr.softsf.sudokufx.viewmodel.HelpViewModel.iOsFolder
private

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