diff --git a/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java b/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java index 60de3eb5d..816fb97e9 100644 --- a/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/fxcomps/impl/ContextualFileReferenceChoiceComp.java @@ -47,6 +47,19 @@ public class ContextualFileReferenceChoiceComp extends Comp> this.filePath = filePath; } + + public ContextualFileReferenceChoiceComp( + Property> fileSystem, Property filePath) { + this.fileSystem = new SimpleObjectProperty<>(); + fileSystem.subscribe(val -> { + this.fileSystem.setValue(val); + }); + this.fileSystem.addListener((observable, oldValue, newValue) -> { + fileSystem.setValue(newValue.get().ref()); + }); + this.filePath = filePath; + } + @Override public CompStructure createBase() { var fileNameComp = new TextFieldComp(filePath)