Search in sources :

Example 11 with DismissAction

use of com.faforever.client.notification.DismissAction 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 12 with DismissAction

use of com.faforever.client.notification.DismissAction 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

DismissAction (com.faforever.client.notification.DismissAction)12 ImmediateNotification (com.faforever.client.notification.ImmediateNotification)11 I18n (com.faforever.client.i18n.I18n)6 NotificationService (com.faforever.client.notification.NotificationService)6 ReportAction (com.faforever.client.notification.ReportAction)6 Severity (com.faforever.client.notification.Severity)6 MethodHandles (java.lang.invoke.MethodHandles)6 Logger (org.slf4j.Logger)6 LoggerFactory (org.slf4j.LoggerFactory)6 PreferencesService (com.faforever.client.preferences.PreferencesService)5 EventBus (com.google.common.eventbus.EventBus)5 Inject (javax.inject.Inject)5 JavaFxUtil (com.faforever.client.fx.JavaFxUtil)4 NavigateEvent (com.faforever.client.main.event.NavigateEvent)4 Path (java.nio.file.Path)4 List (java.util.List)4 CompletableFuture (java.util.concurrent.CompletableFuture)4 Platform (javafx.application.Platform)4 AbstractViewController (com.faforever.client.fx.AbstractViewController)3 ReportingService (com.faforever.client.reporting.ReportingService)3