refactored UpdateReminderComponent.Builder to Factory

This commit is contained in:
Jan-Peter Klein
2023-07-17 15:40:11 +02:00
parent c18f489e9d
commit 14776fc571
3 changed files with 8 additions and 8 deletions

View File

@@ -57,8 +57,8 @@ abstract class FxApplicationModule {
@Provides
@FxApplicationScoped
static UpdateReminderComponent provideUpdateReminderComponent(UpdateReminderComponent.Builder builder) {
return builder.build();
static UpdateReminderComponent provideUpdateReminderComponent(UpdateReminderComponent.Factory factory) {
return factory.create();
}
}

View File

@@ -46,7 +46,7 @@ public class FxApplicationWindows {
private final Lazy<PreferencesComponent> preferencesWindow;
private final QuitComponent.Builder quitWindowBuilder;
private final UnlockComponent.Factory unlockWorkflowFactory;
private final UpdateReminderComponent.Builder updateReminderWindowBuilder;
private final UpdateReminderComponent.Factory updateReminderWindowBuilder;
private final LockComponent.Factory lockWorkflowFactory;
private final ErrorComponent.Factory errorWindowFactory;
private final ExecutorService executor;
@@ -60,7 +60,7 @@ public class FxApplicationWindows {
Lazy<PreferencesComponent> preferencesWindow, //
QuitComponent.Builder quitWindowBuilder, //
UnlockComponent.Factory unlockWorkflowFactory, //
UpdateReminderComponent.Builder updateReminderWindowBuilder, //
UpdateReminderComponent.Factory updateReminderWindowBuilder, //
LockComponent.Factory lockWorkflowFactory, //
ErrorComponent.Factory errorWindowFactory, //
VaultOptionsComponent.Factory vaultOptionsWindow, //
@@ -131,7 +131,7 @@ public class FxApplicationWindows {
}
public void showUpdateReminderWindow() {
CompletableFuture.runAsync(() -> updateReminderWindowBuilder.build().showUpdateReminderWindow(), Platform::runLater);
CompletableFuture.runAsync(() -> updateReminderWindowBuilder.create().showUpdateReminderWindow(), Platform::runLater);
}
public CompletionStage<Void> startUnlockWorkflow(Vault vault, @Nullable Stage owner) {

View File

@@ -25,8 +25,8 @@ public interface UpdateReminderComponent {
stage.show();
}
@Subcomponent.Builder
interface Builder {
UpdateReminderComponent build();
@Subcomponent.Factory
interface Factory {
UpdateReminderComponent create();
}
}