de.factoryfx.javafx.data.widget.dataview.ReferenceAttributeDataView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javafxDataEditing Show documentation
Show all versions of javafxDataEditing Show documentation
factoryfx dependency injection framework
The newest version!
package de.factoryfx.javafx.data.widget.dataview;
import de.factoryfx.data.Data;
import de.factoryfx.data.attribute.*;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import java.util.List;
public class ReferenceAttributeDataView,A>> implements DataView{
private final ReferenceListAttribute refList;
private final AttributeChangeListener, A> listAttributeChangeListener;
private final ObservableList list = FXCollections.observableArrayList();
public ReferenceAttributeDataView(ReferenceListAttribute refList) {
this.refList=refList;
this.listAttributeChangeListener = (attribute, value) -> list.setAll(value);
this.refList.internal_addListener(new WeakAttributeChangeListener<>(listAttributeChangeListener));
}
@Override
public ObservableList dataList(){
list.setAll(refList);
return list;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy