mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-22 12:41:27 +00:00
Made most Window-specific Qualifiers package-private
This commit is contained in:
@@ -17,7 +17,6 @@ import javafx.scene.input.KeyCodeCombination;
|
||||
import javafx.scene.input.KeyCombination;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.StageStyle;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.FXMLLoaderFactory;
|
||||
@@ -39,16 +38,16 @@ import java.util.Set;
|
||||
public abstract class AddVaultModule {
|
||||
|
||||
@Provides
|
||||
@AddVaultWizard
|
||||
@AddVaultWizardWindow
|
||||
@AddVaultWizardScoped
|
||||
static FXMLLoaderFactory provideFxmlLoaderFactory(Map<Class<? extends FxController>, Provider<FxController>> factories, ResourceBundle resourceBundle) {
|
||||
return new FXMLLoaderFactory(factories, resourceBundle);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@AddVaultWizard
|
||||
@AddVaultWizardWindow
|
||||
@AddVaultWizardScoped
|
||||
static Stage provideStage(@MainWindow Stage owner, ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon, @AddVaultWizard Lazy<Map<KeyCodeCombination, Runnable>> accelerators) {
|
||||
static Stage provideStage(@MainWindow Stage owner, ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon, @AddVaultWizardWindow Lazy<Map<KeyCodeCombination, Runnable>> accelerators) {
|
||||
Stage stage = new Stage();
|
||||
stage.setTitle(resourceBundle.getString("addvaultwizard.title"));
|
||||
stage.setResizable(false);
|
||||
@@ -74,7 +73,7 @@ public abstract class AddVaultModule {
|
||||
}
|
||||
|
||||
@Provides
|
||||
@AddVaultWizard
|
||||
@AddVaultWizardWindow
|
||||
@AddVaultWizardScoped
|
||||
static ObjectProperty<Vault> provideVault() {
|
||||
return new SimpleObjectProperty<>();
|
||||
@@ -83,16 +82,16 @@ public abstract class AddVaultModule {
|
||||
// ------------------
|
||||
|
||||
@Provides
|
||||
@AddVaultWizard
|
||||
@AddVaultWizardWindow
|
||||
@AddVaultWizardScoped
|
||||
static Map<KeyCodeCombination, Runnable> provideDefaultAccellerators(@AddVaultWizard Set<Map.Entry<KeyCombination, Runnable>> accelerators) {
|
||||
static Map<KeyCodeCombination, Runnable> provideDefaultAccellerators(@AddVaultWizardWindow Set<Map.Entry<KeyCombination, Runnable>> accelerators) {
|
||||
return Map.ofEntries(accelerators.toArray(Map.Entry[]::new));
|
||||
}
|
||||
|
||||
@Provides
|
||||
@IntoSet
|
||||
@AddVaultWizard
|
||||
static Map.Entry<KeyCombination, Runnable> provideCloseWindowShortcut(@AddVaultWizard Stage window) {
|
||||
@AddVaultWizardWindow
|
||||
static Map.Entry<KeyCombination, Runnable> provideCloseWindowShortcut(@AddVaultWizardWindow Stage window) {
|
||||
if (SystemUtils.IS_OS_WINDOWS) {
|
||||
return Map.entry(new KeyCodeCombination(KeyCode.F4, KeyCombination.ALT_DOWN), window::close);
|
||||
} else {
|
||||
@@ -105,7 +104,7 @@ public abstract class AddVaultModule {
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.ADDVAULT_WELCOME)
|
||||
@AddVaultWizardScoped
|
||||
static Scene provideWelcomeScene(@AddVaultWizard FXMLLoaderFactory fxmlLoaders, @AddVaultWizard Stage window) {
|
||||
static Scene provideWelcomeScene(@AddVaultWizardWindow FXMLLoaderFactory fxmlLoaders, @AddVaultWizardWindow Stage window) {
|
||||
Scene scene = fxmlLoaders.createScene("/fxml/addvault_welcome.fxml");
|
||||
|
||||
KeyCombination cmdW = new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN);
|
||||
@@ -117,35 +116,35 @@ public abstract class AddVaultModule {
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.ADDVAULT_EXISTING)
|
||||
@AddVaultWizardScoped
|
||||
static Scene provideChooseExistingVaultScene(@AddVaultWizard FXMLLoaderFactory fxmlLoaders, @AddVaultWizard Stage window) {
|
||||
static Scene provideChooseExistingVaultScene(@AddVaultWizardWindow FXMLLoaderFactory fxmlLoaders, @AddVaultWizardWindow Stage window) {
|
||||
return fxmlLoaders.createScene("/fxml/addvault_existing.fxml");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.ADDVAULT_NEW_NAME)
|
||||
@AddVaultWizardScoped
|
||||
static Scene provideCreateNewVaultNameScene(@AddVaultWizard FXMLLoaderFactory fxmlLoaders, @AddVaultWizard Stage window) {
|
||||
static Scene provideCreateNewVaultNameScene(@AddVaultWizardWindow FXMLLoaderFactory fxmlLoaders, @AddVaultWizardWindow Stage window) {
|
||||
return fxmlLoaders.createScene("/fxml/addvault_new_name.fxml");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.ADDVAULT_NEW_LOCATION)
|
||||
@AddVaultWizardScoped
|
||||
static Scene provideCreateNewVaultLocationScene(@AddVaultWizard FXMLLoaderFactory fxmlLoaders, @AddVaultWizard Stage window) {
|
||||
static Scene provideCreateNewVaultLocationScene(@AddVaultWizardWindow FXMLLoaderFactory fxmlLoaders, @AddVaultWizardWindow Stage window) {
|
||||
return fxmlLoaders.createScene("/fxml/addvault_new_location.fxml");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.ADDVAULT_NEW_PASSWORD)
|
||||
@AddVaultWizardScoped
|
||||
static Scene provideCreateNewVaultPasswordScene(@AddVaultWizard FXMLLoaderFactory fxmlLoaders, @AddVaultWizard Stage window) {
|
||||
static Scene provideCreateNewVaultPasswordScene(@AddVaultWizardWindow FXMLLoaderFactory fxmlLoaders, @AddVaultWizardWindow Stage window) {
|
||||
return fxmlLoaders.createScene("/fxml/addvault_new_password.fxml");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.ADDVAULT_SUCCESS)
|
||||
@AddVaultWizardScoped
|
||||
static Scene provideCreateNewVaultSuccessScene(@AddVaultWizard FXMLLoaderFactory fxmlLoaders, @AddVaultWizard Stage window) {
|
||||
static Scene provideCreateNewVaultSuccessScene(@AddVaultWizardWindow FXMLLoaderFactory fxmlLoaders, @AddVaultWizardWindow Stage window) {
|
||||
return fxmlLoaders.createScene("/fxml/addvault_success.fxml");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.cryptomator.ui.addvaultwizard;
|
||||
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.stage.Stage;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
@@ -19,7 +18,7 @@ public class AddVaultSuccessController implements FxController {
|
||||
private final ReadOnlyObjectProperty<Vault> vault;
|
||||
|
||||
@Inject
|
||||
AddVaultSuccessController(FxApplication fxApplication, @AddVaultWizard Stage window, @AddVaultWizard ObjectProperty<Vault> vault) {
|
||||
AddVaultSuccessController(FxApplication fxApplication, @AddVaultWizardWindow Stage window, @AddVaultWizardWindow ObjectProperty<Vault> vault) {
|
||||
this.fxApplication = fxApplication;
|
||||
this.window = window;
|
||||
this.vault = vault;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class AddVaultWelcomeController implements FxController {
|
||||
private final Lazy<Scene> createNewVaultScene;
|
||||
|
||||
@Inject
|
||||
AddVaultWelcomeController(@AddVaultWizard Stage window, @FxmlScene(FxmlFile.ADDVAULT_EXISTING) Lazy<Scene> chooseExistingVaultScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy<Scene> createNewVaultScene) {
|
||||
AddVaultWelcomeController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_EXISTING) Lazy<Scene> chooseExistingVaultScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy<Scene> createNewVaultScene) {
|
||||
this.window = window;
|
||||
this.chooseExistingVaultScene = chooseExistingVaultScene;
|
||||
this.createNewVaultScene = createNewVaultScene;
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.cryptomator.ui.common.FxmlScene;
|
||||
@Subcomponent(modules = {AddVaultModule.class})
|
||||
public interface AddVaultWizardComponent {
|
||||
|
||||
@AddVaultWizard
|
||||
@AddVaultWizardWindow
|
||||
Stage window();
|
||||
|
||||
@FxmlScene(FxmlFile.ADDVAULT_WELCOME)
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface AddVaultWizard {
|
||||
@interface AddVaultWizardWindow {
|
||||
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class ChooseExistingVaultController implements FxController {
|
||||
private final ResourceBundle resourceBundle;
|
||||
|
||||
@Inject
|
||||
ChooseExistingVaultController(@AddVaultWizard Stage window, @FxmlScene(FxmlFile.ADDVAULT_WELCOME) Lazy<Scene> welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy<Scene> successScene, ObjectProperty<Path> vaultPath, @AddVaultWizard ObjectProperty<Vault> vault, VaultListManager vaultListManager, ResourceBundle resourceBundle) {
|
||||
ChooseExistingVaultController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_WELCOME) Lazy<Scene> welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy<Scene> successScene, ObjectProperty<Path> vaultPath, @AddVaultWizardWindow ObjectProperty<Vault> vault, VaultListManager vaultListManager, ResourceBundle resourceBundle) {
|
||||
this.window = window;
|
||||
this.welcomeScene = welcomeScene;
|
||||
this.successScene = successScene;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.cryptomator.ui.addvaultwizard;
|
||||
|
||||
import dagger.Lazy;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
@@ -59,7 +58,7 @@ public class CreateNewVaultLocationController implements FxController {
|
||||
public RadioButton customRadioButton;
|
||||
|
||||
@Inject
|
||||
CreateNewVaultLocationController(@AddVaultWizard Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy<Scene> chooseNameScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_PASSWORD) Lazy<Scene> choosePasswordScene, LocationPresets locationPresets, ObjectProperty<Path> vaultPath, StringProperty vaultName, ResourceBundle resourceBundle) {
|
||||
CreateNewVaultLocationController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy<Scene> chooseNameScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_PASSWORD) Lazy<Scene> choosePasswordScene, LocationPresets locationPresets, ObjectProperty<Path> vaultPath, StringProperty vaultName, ResourceBundle resourceBundle) {
|
||||
this.window = window;
|
||||
this.chooseNameScene = chooseNameScene;
|
||||
this.choosePasswordScene = choosePasswordScene;
|
||||
|
||||
@@ -6,9 +6,7 @@ import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.beans.binding.StringBinding;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.TextField;
|
||||
@@ -18,9 +16,6 @@ import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -41,7 +36,7 @@ public class CreateNewVaultNameController implements FxController {
|
||||
private final StringBinding warningText;
|
||||
|
||||
@Inject
|
||||
CreateNewVaultNameController(@AddVaultWizard Stage window, @FxmlScene(FxmlFile.ADDVAULT_WELCOME) Lazy<Scene> welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_LOCATION) Lazy<Scene> chooseLocationScene, ObjectProperty<Path> vaultPath, StringProperty vaultName, ResourceBundle resourceBundle) {
|
||||
CreateNewVaultNameController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_WELCOME) Lazy<Scene> welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_LOCATION) Lazy<Scene> chooseLocationScene, ObjectProperty<Path> vaultPath, StringProperty vaultName, ResourceBundle resourceBundle) {
|
||||
this.window = window;
|
||||
this.welcomeScene = welcomeScene;
|
||||
this.chooseLocationScene = chooseLocationScene;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class CreateNewVaultPasswordController implements FxController {
|
||||
public CheckBox finalConfirmationCheckbox;
|
||||
|
||||
@Inject
|
||||
CreateNewVaultPasswordController(@AddVaultWizard Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_LOCATION) Lazy<Scene> chooseLocationScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy<Scene> successScene, ExecutorService executor, StringProperty vaultName, ObjectProperty<Path> vaultPath, @AddVaultWizard ObjectProperty<Vault> vault, VaultListManager vaultListManager, ResourceBundle resourceBundle, PasswordStrengthUtil strengthRater, ReadmeGenerator readmeGenerator) {
|
||||
CreateNewVaultPasswordController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_LOCATION) Lazy<Scene> chooseLocationScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy<Scene> successScene, ExecutorService executor, StringProperty vaultName, ObjectProperty<Path> vaultPath, @AddVaultWizardWindow ObjectProperty<Vault> vault, VaultListManager vaultListManager, ResourceBundle resourceBundle, PasswordStrengthUtil strengthRater, ReadmeGenerator readmeGenerator) {
|
||||
this.window = window;
|
||||
this.chooseLocationScene = chooseLocationScene;
|
||||
this.successScene = successScene;
|
||||
|
||||
@@ -9,6 +9,8 @@ import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
|
||||
import javax.inject.Named;
|
||||
|
||||
@ChangePasswordScoped
|
||||
@Subcomponent(modules = {ChangePasswordModule.class})
|
||||
public interface ChangePasswordComponent {
|
||||
@@ -31,6 +33,9 @@ public interface ChangePasswordComponent {
|
||||
@BindsInstance
|
||||
Builder vault(@ChangePasswordWindow Vault vault);
|
||||
|
||||
@BindsInstance
|
||||
Builder owner(@Named("changePasswordOwner") Stage owner);
|
||||
|
||||
ChangePasswordComponent build();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.common.FxControllerKey;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.cryptomator.ui.vaultoptions.VaultOptionsWindow;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Provider;
|
||||
@@ -34,7 +33,7 @@ abstract class ChangePasswordModule {
|
||||
@Provides
|
||||
@ChangePasswordWindow
|
||||
@ChangePasswordScoped
|
||||
static Stage provideStage(@VaultOptionsWindow Stage owner, ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon) {
|
||||
static Stage provideStage(@Named("changePasswordOwner") Stage owner, ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon) {
|
||||
Stage stage = new Stage();
|
||||
stage.setTitle(resourceBundle.getString("changepassword.title"));
|
||||
stage.setResizable(false);
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface ChangePasswordWindow {
|
||||
@interface ChangePasswordWindow {
|
||||
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ import java.util.concurrent.CompletableFuture;
|
||||
@Subcomponent(modules = {ForgetPasswordModule.class})
|
||||
public interface ForgetPasswordComponent {
|
||||
|
||||
@ForgetPassword
|
||||
@ForgetPasswordWindow
|
||||
ReadOnlyBooleanProperty confirmedProperty();
|
||||
|
||||
@ForgetPassword
|
||||
@ForgetPasswordWindow
|
||||
Stage window();
|
||||
|
||||
@FxmlScene(FxmlFile.FORGET_PASSWORD)
|
||||
@@ -40,7 +40,7 @@ public interface ForgetPasswordComponent {
|
||||
interface Builder {
|
||||
|
||||
@BindsInstance
|
||||
Builder vault(@ForgetPassword Vault vault);
|
||||
Builder vault(@ForgetPasswordWindow Vault vault);
|
||||
|
||||
@BindsInstance
|
||||
Builder owner(@Named("forgetPasswordOwner") Stage owner);
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ForgetPasswordController implements FxController {
|
||||
private final BooleanProperty confirmedResult;
|
||||
|
||||
@Inject
|
||||
public ForgetPasswordController(@ForgetPassword Stage window, @ForgetPassword Vault vault, Optional<KeychainAccess> keychainAccess, @ForgetPassword BooleanProperty confirmedResult) {
|
||||
public ForgetPasswordController(@ForgetPasswordWindow Stage window, @ForgetPasswordWindow Vault vault, Optional<KeychainAccess> keychainAccess, @ForgetPasswordWindow BooleanProperty confirmedResult) {
|
||||
this.window = window;
|
||||
this.vault = vault;
|
||||
this.keychainAccess = keychainAccess;
|
||||
|
||||
@@ -27,14 +27,14 @@ import java.util.ResourceBundle;
|
||||
abstract class ForgetPasswordModule {
|
||||
|
||||
@Provides
|
||||
@ForgetPassword
|
||||
@ForgetPasswordWindow
|
||||
@ForgetPasswordScoped
|
||||
static FXMLLoaderFactory provideFxmlLoaderFactory(Map<Class<? extends FxController>, Provider<FxController>> factories, ResourceBundle resourceBundle) {
|
||||
return new FXMLLoaderFactory(factories, resourceBundle);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ForgetPassword
|
||||
@ForgetPasswordWindow
|
||||
@ForgetPasswordScoped
|
||||
static Stage provideStage(ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon, @Named("forgetPasswordOwner") Stage owner) {
|
||||
Stage stage = new Stage();
|
||||
@@ -49,21 +49,21 @@ abstract class ForgetPasswordModule {
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.FORGET_PASSWORD)
|
||||
@ForgetPasswordScoped
|
||||
static Scene provideForgetPasswordScene(@ForgetPassword FXMLLoaderFactory fxmlLoaders, @ForgetPassword Stage window) {
|
||||
static Scene provideForgetPasswordScene(@ForgetPasswordWindow FXMLLoaderFactory fxmlLoaders, @ForgetPasswordWindow Stage window) {
|
||||
return fxmlLoaders.createScene("/fxml/forget_password.fxml");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ForgetPassword
|
||||
@ForgetPasswordWindow
|
||||
@ForgetPasswordScoped
|
||||
static BooleanProperty provideConfirmedProperty() {
|
||||
return new SimpleBooleanProperty(false);
|
||||
}
|
||||
|
||||
@Binds
|
||||
@ForgetPassword
|
||||
@ForgetPasswordWindow
|
||||
@ForgetPasswordScoped
|
||||
abstract ReadOnlyBooleanProperty bindReadOnlyConfirmedProperty(@ForgetPassword BooleanProperty confirmedProperty);
|
||||
abstract ReadOnlyBooleanProperty bindReadOnlyConfirmedProperty(@ForgetPasswordWindow BooleanProperty confirmedProperty);
|
||||
|
||||
// ------------------
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface ForgetPassword {
|
||||
@interface ForgetPasswordWindow {
|
||||
|
||||
}
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface MigrationWindow {
|
||||
@interface MigrationWindow {
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface PreferencesWindow {
|
||||
@interface PreferencesWindow {
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface QuitWindow {
|
||||
@interface QuitWindow {
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.cryptomator.ui.common.FxmlScene;
|
||||
@Subcomponent(modules = {RemoveVaultModule.class})
|
||||
public interface RemoveVaultComponent {
|
||||
|
||||
@RemoveVault
|
||||
@RemoveVaultWindow
|
||||
Stage window();
|
||||
|
||||
@FxmlScene(FxmlFile.REMOVE_VAULT)
|
||||
@@ -30,7 +30,7 @@ public interface RemoveVaultComponent {
|
||||
interface Builder {
|
||||
|
||||
@BindsInstance
|
||||
Builder vault(@RemoveVault Vault vault);
|
||||
Builder vault(@RemoveVaultWindow Vault vault);
|
||||
|
||||
RemoveVaultComponent build();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class RemoveVaultController implements FxController {
|
||||
private final ObservableList<Vault> vaults;
|
||||
|
||||
@Inject
|
||||
public RemoveVaultController(@RemoveVault Stage window, @RemoveVault Vault vault, ObservableList<Vault> vaults) {
|
||||
public RemoveVaultController(@RemoveVaultWindow Stage window, @RemoveVaultWindow Vault vault, ObservableList<Vault> vaults) {
|
||||
this.window = window;
|
||||
this.vault = vault;
|
||||
this.vaults = vaults;
|
||||
|
||||
@@ -28,14 +28,14 @@ import java.util.ResourceBundle;
|
||||
abstract class RemoveVaultModule {
|
||||
|
||||
@Provides
|
||||
@RemoveVault
|
||||
@RemoveVaultWindow
|
||||
@RemoveVaultScoped
|
||||
static FXMLLoaderFactory provideFxmlLoaderFactory(Map<Class<? extends FxController>, Provider<FxController>> factories, ResourceBundle resourceBundle) {
|
||||
return new FXMLLoaderFactory(factories, resourceBundle);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@RemoveVault
|
||||
@RemoveVaultWindow
|
||||
@RemoveVaultScoped
|
||||
static Stage provideStage(@MainWindow Stage owner, ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon) {
|
||||
Stage stage = new Stage();
|
||||
@@ -50,7 +50,7 @@ abstract class RemoveVaultModule {
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.REMOVE_VAULT)
|
||||
@RemoveVaultScoped
|
||||
static Scene provideRemoveVaultScene(@RemoveVault FXMLLoaderFactory fxmlLoaders, @RemoveVault Stage window) {
|
||||
static Scene provideRemoveVaultScene(@RemoveVaultWindow FXMLLoaderFactory fxmlLoaders, @RemoveVaultWindow Stage window) {
|
||||
Scene scene = fxmlLoaders.createScene("/fxml/remove_vault.fxml");
|
||||
|
||||
KeyCombination cmdW = new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN);
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface RemoveVault {
|
||||
@interface RemoveVaultWindow {
|
||||
|
||||
}
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface UnlockWindow {
|
||||
@interface UnlockWindow {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.cryptomator.ui.vaultoptions;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.stage.Stage;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.changepassword.ChangePasswordComponent;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
@@ -11,17 +12,19 @@ import javax.inject.Inject;
|
||||
public class GeneralVaultOptionsController implements FxController {
|
||||
|
||||
private final Vault vault;
|
||||
private final Stage window;
|
||||
private final ChangePasswordComponent.Builder changePasswordWindow;
|
||||
|
||||
@Inject
|
||||
GeneralVaultOptionsController(@VaultOptionsWindow Vault vault, ChangePasswordComponent.Builder changePasswordWindow) {
|
||||
GeneralVaultOptionsController(@VaultOptionsWindow Vault vault, @VaultOptionsWindow Stage window, ChangePasswordComponent.Builder changePasswordWindow) {
|
||||
this.vault = vault;
|
||||
this.window = window;
|
||||
this.changePasswordWindow = changePasswordWindow;
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void changePassword() {
|
||||
changePasswordWindow.vault(vault).build().showChangePasswordWindow();
|
||||
changePasswordWindow.vault(vault).owner(window).build().showChangePasswordWindow();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface VaultOptionsWindow {
|
||||
@interface VaultOptionsWindow {
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.cryptomator.ui.common.FxmlScene;
|
||||
@Subcomponent(modules = {WrongFileAlertModule.class})
|
||||
public interface WrongFileAlertComponent {
|
||||
|
||||
@WrongFileAlert
|
||||
@WrongFileAlertWindow
|
||||
Stage window();
|
||||
|
||||
@FxmlScene(FxmlFile.WRONGFILEALERT)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class WrongFileAlertController implements FxController {
|
||||
private final Stage window;
|
||||
|
||||
@Inject
|
||||
public WrongFileAlertController(@WrongFileAlert Stage window) {
|
||||
public WrongFileAlertController(@WrongFileAlertWindow Stage window) {
|
||||
this.window = window;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,14 +27,14 @@ import java.util.ResourceBundle;
|
||||
abstract class WrongFileAlertModule {
|
||||
|
||||
@Provides
|
||||
@WrongFileAlert
|
||||
@WrongFileAlertWindow
|
||||
@WrongFileAlertScoped
|
||||
static FXMLLoaderFactory provideFxmlLoaderFactory(Map<Class<? extends FxController>, Provider<FxController>> factories, ResourceBundle resourceBundle) {
|
||||
return new FXMLLoaderFactory(factories, resourceBundle);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@WrongFileAlert
|
||||
@WrongFileAlertWindow
|
||||
@WrongFileAlertScoped
|
||||
static Stage provideStage(ResourceBundle resourceBundle, @Named("windowIcon") Optional<Image> windowIcon) {
|
||||
Stage stage = new Stage();
|
||||
@@ -48,7 +48,7 @@ abstract class WrongFileAlertModule {
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.WRONGFILEALERT)
|
||||
@WrongFileAlertScoped
|
||||
static Scene provideWrongFileAlertScene(@WrongFileAlert FXMLLoaderFactory fxmlLoaders, @WrongFileAlert Stage window) {
|
||||
static Scene provideWrongFileAlertScene(@WrongFileAlertWindow FXMLLoaderFactory fxmlLoaders, @WrongFileAlertWindow Stage window) {
|
||||
Scene scene = fxmlLoaders.createScene("/fxml/wrongfilealert.fxml"); // TODO rename fxml file
|
||||
|
||||
KeyCombination cmdW = new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN);
|
||||
|
||||
@@ -9,6 +9,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface WrongFileAlert {
|
||||
@interface WrongFileAlertWindow {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user