Interface Dialogs
public interface Dialogs
Dialogs used by emuStudio and plugins.
If GUI is enabled, the dialogs are shown on the screen. Otherwise, they are logged and read* methods return empty values. Each method requires a title; initial values and base directories are nullable.
Example: dialogs.showError("Cannot open file", "Open file")
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionAsks a yes/no/cancel question.chooseDirectory(String title, String approveButtonText, Path baseDirectory) Shows directory chooser.chooseFile(String title, String approveButtonText, Path baseDirectory, boolean appendMissingExtension, List<FileType> fileTypes) Shows file chooser.readDouble(String message, String title, Double initial) readInteger(String message, String title, Integer initial) readString(String message, String title, String initial) voidvoid
-
Method Details
-
showError
-
showInfo
-
ask
Asks a yes/no/cancel question.- Parameters:
message- questiontitle- dialog title- Returns:
- answer
-
readString
-
readInteger
-
readDouble
-
chooseFile
Optional<Path> chooseFile(String title, String approveButtonText, Path baseDirectory, boolean appendMissingExtension, List<FileType> fileTypes) Shows file chooser.- Parameters:
title- dialog titleapproveButtonText- approve button textbaseDirectory- initial directory, or null for current directoryappendMissingExtension- whether to append the first extension of selected file type if missingfileTypes- file types to filter- Returns:
- selected file; empty if cancelled
-
chooseDirectory
Shows directory chooser.- Parameters:
title- dialog titleapproveButtonText- approve button textbaseDirectory- initial directory, or null for current directory- Returns:
- selected directory; empty if cancelled
-