MCPcopy Index your code
hub / github.com/CodeDead/opal / showErrorAlert

Method showErrorAlert

src/main/java/com/codedead/opal/utils/FxUtils.java:67–83  ·  view source on GitHub ↗

Show an error message to the user @param header The content of the header @param content The content of the error message @param imageStream The InputStream object that contains the image for the Alert object

(final String header, final String content, final InputStream imageStream)

Source from the content-addressed store, hash-verified

65 * @param imageStream The {@link InputStream} object that contains the image for the {@link Alert} object
66 */
67 public static void showErrorAlert(final String header, final String content, final InputStream imageStream) {
68 if (header == null)
69 throw new NullPointerException("Header cannot be null!");
70 if (content == null)
71 throw new NullPointerException("Content cannot be null!");
72
73 final Alert alert = getErrorAlert(content);
74 alert.setHeaderText(header);
75
76 final Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
77
78 if (imageStream != null) {
79 stage.getIcons().add(new Image(imageStream));
80 }
81
82 alert.showAndWait();
83 }
84
85 /**
86 * Generate a new error {@link Alert} object

Callers 15

startMethod · 0.95
runMethod · 0.95
openLicenseFileMethod · 0.95
setControllersMethod · 0.95
checkForUpdatesMethod · 0.95
runMethod · 0.95
openFileMethod · 0.95
addCustomSoundMethod · 0.95
openSoundPresetMethod · 0.95
playPauseActionMethod · 0.95
settingsActionMethod · 0.95
helpActionMethod · 0.95

Calls 1

getErrorAlertMethod · 0.95

Tested by

no test coverage detected