|
@@ -1,24 +1,25 @@
|
|
|
package org.cryptomator.ui.common;
|
|
|
|
|
|
+import dagger.Lazy;
|
|
|
import org.cryptomator.common.vaults.Volume;
|
|
|
-import org.cryptomator.ui.launcher.FxApplicationStarter;
|
|
|
+import org.cryptomator.ui.fxapp.FxApplicationScoped;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
-import javax.inject.Singleton;
|
|
|
+import javafx.application.Application;
|
|
|
import java.nio.file.Path;
|
|
|
|
|
|
-@Singleton
|
|
|
+@FxApplicationScoped
|
|
|
public class HostServiceRevealer implements Volume.Revealer {
|
|
|
|
|
|
- private final FxApplicationStarter fxApplicationStarter;
|
|
|
+ private final Lazy<Application> application;
|
|
|
|
|
|
@Inject
|
|
|
- public HostServiceRevealer(FxApplicationStarter fxApplicationStarter) {
|
|
|
- this.fxApplicationStarter = fxApplicationStarter;
|
|
|
+ public HostServiceRevealer(Lazy<Application> application) {
|
|
|
+ this.application = application;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void reveal(Path p) throws Volume.VolumeException {
|
|
|
- fxApplicationStarter.get().thenAccept(app -> app.getHostServices().showDocument(p.toUri().toString()));
|
|
|
+ application.get().getHostServices().showDocument(p.toUri().toString());
|
|
|
}
|
|
|
}
|