private void showLicensePopup() { Alert licenseAlert = new Alert(AlertType.INFORMATION); licenseAlert.setWidth(500); licenseAlert.setHeaderText("License"); ScrollPane scroll = new ScrollPane(); try { scroll.setContent(new TextArea(IOUtils.toString(getClass().getResourceAsStream("LICENSE"), StandardCharsets.UTF_8))); } catch (IOException e) { e.printStackTrace(); } licenseAlert.getDialogPane().setContent(scroll); licenseAlert.showAndWait(); }
@Override public Optional<ButtonType> showWarning(String title, String message) { final Alert alert = new Alert(Alert.AlertType.CONFIRMATION); final Scene scene = alert.getDialogPane().getScene(); BrandUtil.applyBrand(injector, stage, scene); alert.setTitle("Confirmation"); alert.setHeaderText(title); alert.setContentText(message); alert.setGraphic(FontAwesome.EXCLAMATION_TRIANGLE.view()); return alert.showAndWait(); }
@Override public void showError(String title, String message, Throwable ex) { final Alert alert = new Alert(Alert.AlertType.ERROR); final Scene scene = alert.getDialogPane().getScene();
private static void displayUpdateDownloadAlert() { final Alert selfupdateStartedAlert = new Alert( Alert.AlertType.CONFIRMATION, "Started downloading update in the background. We will tell you when it is ready !", ButtonType.OK ); selfupdateStartedAlert.showAndWait(); }
/** * Displays an alert to the user informing them that the selfupdate is ready to start and they need to restart the * application after we automatically stop it. */ private static void displayRestartAlert() { LOG.debug("Displaying restart information alert!"); final Alert restartAlert = new Alert( Alert.AlertType.INFORMATION, "Lyrebird has downloaded the update! " + "The application will automatically quit and start updating!", ButtonType.OK ); restartAlert.showAndWait(); }
/** * Show error alert that close app. * * @param throwable cause of error */ private static void showErrorAlert(Throwable throwable) { Alert alert = new Alert(AlertType.ERROR, "Oops! An unrecoverable error occurred.\n" + "Please contact your software vendor.\n\n" + "The application will stop now.\n\n" + "Error: " + throwable.getMessage()); alert.showAndWait().ifPresent(response -> Platform.exit()); }
private void setAlert(final String title, final String header, final String content) { final Alert alert = new Alert(AlertType.WARNING); alert.setTitle(RESOURCES.getString(title)); alert.setHeaderText(RESOURCES.getString(header)); alert.setContentText(RESOURCES.getString(content)); alert.showAndWait(); }
public static void showDraggingError() { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle(RESOURCE_BUNDLE.getString("DragError")); alert.setHeaderText(GSE_ERROR); alert.setContentText(RESOURCE_BUNDLE.getString("FileExists")); alert.showAndWait(); }
public static Optional<ButtonType> showSaveAndQuitDialog(String documentName) { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setHeaderText(MessageFormat.format(RESOURCE_BUNDLE.getString("SaveBeforeClosing"), documentName)); alert.setContentText(RESOURCE_BUNDLE.getString("WarnSaveBeforeClosing")); ButtonType save = new ButtonType(RESOURCE_BUNDLE.getString("Save"), ButtonBar.ButtonData.YES); ButtonType dontSave = new ButtonType(RESOURCE_BUNDLE.getString("DontSave"), ButtonBar.ButtonData.NO); alert.getButtonTypes().setAll(save, dontSave, ButtonType.CANCEL); return alert.showAndWait(); }
private void createWarning() { Alert connectionLostAlert = new Alert(AlertType.WARNING); connectionLostAlert.setHeaderText("Lost connection"); connectionLostAlert.initOwner(mainWindow); connectionLostAlert.showAndWait(); } }
@FXML void uploadLogsCheckboxOnAction(ActionEvent event) { if (gitHubIssue.getThrowable() != null && !uploadLogsCheckbox.isSelected()) { (new Alert(Alert.AlertType.WARNING, bundle.getString("uploadLogsExceptionInfo"), ButtonType.OK)).show(); } }
public static void showDialogError(String message) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle(GSE_ERROR); alert.setResizable(true); alert.setContentText(message); alert.showAndWait(); }
/** * Shows an info dialog. * * @param message the message */ public void showInfoDialog(String message) { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle(FxFxBundle.getString("INFORMATION")); setAlertMessage(alert, message); alert.showAndWait(); }
private void setAlert(final String title, final String header, final String content) { final Alert alert = new Alert(AlertType.WARNING); alert.setTitle(title); alert.setHeaderText(header); alert.setContentText(content); alert.showAndWait(); }
public static void showInformation(String title, String message) { final Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.initStyle(StageStyle.UNDECORATED); alert.setTitle("Information"); alert.setHeaderText(title); alert.setContentText(message); alert.showAndWait(); }
private void deleteSelected(Window owner) { if (uniformDesign.isAskBeforeDelete()){ Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.initOwner(owner); alert.setTitle(uniformDesign.getText(deleteConfirmationTitle)); alert.setHeaderText(uniformDesign.getText(deleteConfirmationHeader)); alert.setContentText(uniformDesign.getText(deleteConfirmationContent)); Optional<ButtonType> result = alert.showAndWait(); if (result.isPresent()){ if (result.get() != ButtonType.OK){ return; } } } final List<T> selectedItems = new ArrayList<>(tableView.getSelectionModel().getSelectedItems()); selectedItems.forEach(t -> deleter.accept(t,referenceListAttribute)); }
public static void showError(String title, String message) { final Alert alert = new Alert(Alert.AlertType.ERROR); alert.initStyle(StageStyle.UTILITY); alert.setTitle("Error"); alert.setHeaderText(title); alert.setContentText(message); alert.showAndWait(); }
public static void showWarning(String title, String message) { final Alert alert = new Alert(Alert.AlertType.WARNING); alert.initStyle(StageStyle.UTILITY); alert.setTitle("Warning"); alert.setHeaderText(title); alert.setContentText(message); alert.showAndWait(); }
@Override public void showMessageDialog(final Window parent, final Alert.AlertType alertType, final String titleKey, final String messageKey, final Object... arguments) { final String message = fxResources.getString(messageKey, arguments); final Alert alert = new Alert(alertType, message); alert.initOwner(parent); alert.setTitle(fxResources.getString(titleKey)); alert.setHeaderText(null); alert.showAndWait(); }
@Override public Optional<ButtonType> showConfirmationDialog(final Window parent, final String titleKey, final String messageKey, final ButtonType... buttonTypes) { final Alert alert = new Alert(Alert.AlertType.CONFIRMATION, fxResources.getString(messageKey)); alert.initOwner(parent); alert.setTitle(fxResources.getString(titleKey)); alert.setHeaderText(null); // add custom button types if specified if (buttonTypes.length > 0) { alert.getButtonTypes().setAll(buttonTypes); } return alert.showAndWait(); }