use of com.faforever.client.notification.ReportAction in project downlords-faf-client by FAForever.
the class LeaderboardController method onDisplay.
@Override
public void onDisplay(NavigateEvent navigateEvent) {
Assert.checkNullIllegalState(ratingType, "ratingType must not be null");
contentPane.setVisible(false);
leaderboardService.getEntries(ratingType).thenAccept(leaderboardEntryBeans -> {
ratingTable.setItems(observableList(leaderboardEntryBeans));
contentPane.setVisible(true);
}).exceptionally(throwable -> {
contentPane.setVisible(false);
logger.warn("Error while loading leaderboard entries", throwable);
notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("leaderboard.failedToLoad"), Severity.ERROR, throwable, Arrays.asList(new ReportAction(i18n, reportingService, throwable), new DismissAction(i18n))));
return null;
});
}
use of com.faforever.client.notification.ReportAction in project downlords-faf-client by FAForever.
the class AbstractChatTabController method sendMessage.
private void sendMessage() {
TextInputControl messageTextField = messageTextField();
messageTextField.setDisable(true);
final String text = messageTextField.getText();
chatService.sendMessageInBackground(receiver, text).thenAccept(message -> {
messageTextField.clear();
messageTextField.setDisable(false);
messageTextField.requestFocus();
}).exceptionally(throwable -> {
logger.warn("Message could not be sent: {}", text, throwable);
notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("chat.sendFailed"), Severity.ERROR, throwable, Arrays.asList(new ReportAction(i18n, reportingService, throwable), new DismissAction(i18n))));
messageTextField.setDisable(false);
messageTextField.requestFocus();
return null;
});
}
Aggregations