我正在创建一个PropertySheet
并且我想Property
在工作表中添加一个。问题是,如果属性的值发生变化会发生什么,PropertySheet
需要更新以反映这些变化。我该怎么做?
import java.util.Map;
import javafx.beans.property.Property;
import org.controlsfx.control.PropertySheet;
public class PropertyItem implements PropertySheet.Item {
private Map<String, Property> map;
private String key;
private String name;
private String description;
PropertyItem(Map<String, Property> map, String key, String name, String description){
this.map = map;
this.key = key;
this.name = name;
this.description = description;
}
@Override
public String getCategory() {
return null;
}
@Override
public String getDescription() {
return description;
}
@Override
public String getName() {
return name;
}
@Override
public Class<?> getType() {
return map.get(key).getValue().getClass();
}
@Override
public Object getValue() {
return map.get(key).getValue();
}
@Override
public void setValue(Object arg0) {
map.get(key).setValue(arg0);
}
}