mirror of
https://github.com/xpipe-io/xpipe.git
synced 2025-04-19 02:33:39 +00:00
Update file host on file choice if needed
This commit is contained in:
parent
63d9cce78e
commit
3363ad9f41
1 changed files with 13 additions and 0 deletions
|
@ -47,6 +47,19 @@ public class ContextualFileReferenceChoiceComp extends Comp<CompStructure<HBox>>
|
|||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
|
||||
public <T extends FileSystemStore> ContextualFileReferenceChoiceComp(
|
||||
Property<DataStoreEntryRef<T>> fileSystem, Property<String> 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<HBox> createBase() {
|
||||
var fileNameComp = new TextFieldComp(filePath)
|
||||
|
|
Loading…
Add table
Reference in a new issue