Browse Source

refactored UpdateReminderComponent.Builder to Factory

Jan-Peter Klein 1 year ago
parent
commit
14776fc571

+ 2 - 2
src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java

@@ -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();
 	}
 
 }

+ 3 - 3
src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java

@@ -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) {

+ 3 - 3
src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java

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