/******************************************************************************************************************* * ******************************************************************************************************************/ private void onButtonDialogOkCancelPressed() { presentation.notify(notificationWithFeedback() .withCaption("Notification") .withText("Now press the button") .withFeedback(feedback().withOnConfirm(() -> presentation.notify("Pressed ok")) .withOnCancel(() -> presentation.notify("Pressed cancel")))); }
/******************************************************************************************************************* * * This method demonstrates how to pick a directory name by using the proper UI dialog. * ******************************************************************************************************************/ private void onButtonPickDirectoryPressed() { final BoundProperty<Path> selectedFolder = new BoundProperty<>(USER_HOME); presentation.pickDirectory(selectedFolder, notificationWithFeedback() .withCaption("Pick a directory") .withFeedback(feedback().withOnConfirm(() -> presentation.notify("Selected folder: " + selectedFolder.get())) .withOnCancel(() -> presentation.notify("Selection cancelled")))); }
/******************************************************************************************************************* * * This method demonstrates how to pick a file name by using the proper UI dialog. * ******************************************************************************************************************/ private void onButtonPickFilePressed() { final BoundProperty<Path> selectedFile = new BoundProperty<>(USER_HOME); presentation.pickFile(selectedFile, notificationWithFeedback() .withCaption("Pick a file") .withFeedback(feedback().withOnConfirm(() -> presentation.notify("Selected file: " + selectedFile.get())) .withOnCancel(() -> presentation.notify("Selection cancelled")))); }