use of org.controlsfx.control.Notifications in project selenium_java by sergueik.
the class MainViewController method onAvailableUpdate.
private void onAvailableUpdate(GithubRelease githubRelease) {
Notifications n = Notifications.create().title("New release available!").text("You are currently running binjr version " + AppEnvironment.getInstance().getVersion() + "\t\t.\nVersion " + githubRelease.getVersion() + " is now available.").hideAfter(Duration.seconds(20)).position(Pos.BOTTOM_RIGHT).owner(root);
n.action(new Action("Download", actionEvent -> {
String newReleaseUrl = githubRelease.getHtmlUrl();
if (newReleaseUrl != null && newReleaseUrl.trim().length() > 0) {
try {
Dialogs.launchUrlInExternalBrowser(newReleaseUrl);
} catch (IOException | URISyntaxException e) {
logger.error("Failed to launch url in browser " + newReleaseUrl, e);
}
}
n.hideAfter(Duration.seconds(0));
}));
n.showInformation();
}
Aggregations