void renamePlaylist() { if (interfaceDisabled) return; Playlist p = getSelectedPlaylist(); if (p == null) return; TextInputDialog dialog = new TextInputDialog(p.getTitle()); dialog.setTitle(res.getString("rename_playlist")); dialog.setHeaderText(res.getString("rename_playlist")); dialog.setContentText(res.getString("enter_new_title")); dialog.getDialogPane().getStylesheets().add("/styles/dialogs.css"); ((Stage) dialog.getDialogPane().getScene().getWindow()).getIcons().addAll(logoImages); Optional<String> result = dialog.showAndWait(); result.ifPresent( title -> { if (StringUtils.isEmpty(title)) { return; } Cache.renamePlaylist(p, title); Platform.runLater( () -> { updatePlaylists(); }); }); }