Search in sources :

Example 21 with ImmediateNotification

use of com.faforever.client.notification.ImmediateNotification in project downlords-faf-client by FAForever.

the class MapVaultController method displayMapsFromSupplier.

private void displayMapsFromSupplier(Supplier<CompletableFuture<List<MapBean>>> mapsSupplier) {
    currentPage = 0;
    this.currentSupplier = mapsSupplier;
    mapsSupplier.get().thenAccept(this::displayMaps).exceptionally(e -> {
        notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("vault.replays.searchError"), Severity.ERROR, e, Collections.singletonList(new DismissAction(i18n))));
        enterShowroomState();
        return null;
    });
}
Also used : ImmediateNotification(com.faforever.client.notification.ImmediateNotification) DismissAction(com.faforever.client.notification.DismissAction)

Example 22 with ImmediateNotification

use of com.faforever.client.notification.ImmediateNotification in project downlords-faf-client by FAForever.

the class ModVaultController method onLoadMoreButtonClicked.

public void onLoadMoreButtonClicked() {
    moreButton.setVisible(false);
    loadingLabel.setVisible(true);
    currentSupplier.get().thenAccept(mods -> {
        appendSearchResult(mods, searchResultPane);
        enterSearchResultState();
    }).exceptionally(e -> {
        notificationService.addNotification(new ImmediateNotification(i18n.get("errorTitle"), i18n.get("vault.mod.searchError"), Severity.ERROR, e, Collections.singletonList(new DismissAction(i18n))));
        enterShowroomState();
        return null;
    });
}
Also used : PreferencesService(com.faforever.client.preferences.PreferencesService) SearchController(com.faforever.client.vault.search.SearchController) Button(javafx.scene.control.Button) StageStyle(javafx.stage.StageStyle) UiService(com.faforever.client.theme.UiService) SearchConfig(com.faforever.client.vault.search.SearchController.SearchConfig) ModUploadedEvent(com.faforever.client.mod.event.ModUploadedEvent) LoggerFactory(org.slf4j.LoggerFactory) CompletableFuture(java.util.concurrent.CompletableFuture) Supplier(java.util.function.Supplier) Iterators(com.google.common.collect.Iterators) Scope(org.springframework.context.annotation.Scope) NavigateEvent(com.faforever.client.main.event.NavigateEvent) EventBus(com.google.common.eventbus.EventBus) Inject(javax.inject.Inject) WindowController(com.faforever.client.fx.WindowController) NotificationService(com.faforever.client.notification.NotificationService) ScrollPane(javafx.scene.control.ScrollPane) Subscribe(com.google.common.eventbus.Subscribe) Path(java.nio.file.Path) SearchableProperties(com.faforever.client.query.SearchableProperties) Pane(javafx.scene.layout.Pane) DirectoryChooser(javafx.stage.DirectoryChooser) Modality(javafx.stage.Modality) Logger(org.slf4j.Logger) JavaFxUtil(com.faforever.client.fx.JavaFxUtil) Node(javafx.scene.Node) MethodHandles(java.lang.invoke.MethodHandles) CLOSE(com.faforever.client.fx.WindowController.WindowButtonType.CLOSE) AbstractViewController(com.faforever.client.fx.AbstractViewController) DismissAction(com.faforever.client.notification.DismissAction) Collectors(java.util.stream.Collectors) File(java.io.File) Platform(javafx.application.Platform) Slf4j(lombok.extern.slf4j.Slf4j) Component(org.springframework.stereotype.Component) List(java.util.List) Stage(javafx.stage.Stage) Severity(com.faforever.client.notification.Severity) AnchorPane(javafx.scene.layout.AnchorPane) ImmediateNotification(com.faforever.client.notification.ImmediateNotification) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ObservableList(javafx.collections.ObservableList) I18n(com.faforever.client.i18n.I18n) ConfigurableBeanFactory(org.springframework.beans.factory.config.ConfigurableBeanFactory) Collections(java.util.Collections) ImmediateNotification(com.faforever.client.notification.ImmediateNotification) DismissAction(com.faforever.client.notification.DismissAction)

Aggregations

ImmediateNotification (com.faforever.client.notification.ImmediateNotification)22 DismissAction (com.faforever.client.notification.DismissAction)12 ReportAction (com.faforever.client.notification.ReportAction)12 I18n (com.faforever.client.i18n.I18n)7 NotificationService (com.faforever.client.notification.NotificationService)7 Severity (com.faforever.client.notification.Severity)7 EventBus (com.google.common.eventbus.EventBus)6 MethodHandles (java.lang.invoke.MethodHandles)6 Path (java.nio.file.Path)6 Inject (javax.inject.Inject)6 Logger (org.slf4j.Logger)6 LoggerFactory (org.slf4j.LoggerFactory)6 PreferencesService (com.faforever.client.preferences.PreferencesService)5 List (java.util.List)5 Component (org.springframework.stereotype.Component)5 JavaFxUtil (com.faforever.client.fx.JavaFxUtil)4 NavigateEvent (com.faforever.client.main.event.NavigateEvent)4 Action (com.faforever.client.notification.Action)4 Subscribe (com.google.common.eventbus.Subscribe)4 IOException (java.io.IOException)4