From PropertySheet:
/**
* Sets a new editor factory used by the PropertySheet to determine which
* {@link PropertyEditor} to use for a given {@link Item}.
* @param factory
*/
public final void setPropertyEditorFactory( Callback<Item, PropertyEditor<?>> factory ) {
propertyEditorFactory.set( factory == null? new DefaultPropertyEditorFactory(): factory );
}
If you create a callback to a PropertyEditor you can add listeners to the editor.
For example:
SimpleObjectProperty<Callback<PropertySheet.Item, PropertyEditor<?>>> propertyEditorFactory = new SimpleObjectProperty<>(this, "propertyEditor", new DefaultPropertyEditorFactory());
projectSheet.setPropertyEditorFactory(getItemPropertyEditorCallback(propertyEditorFactory));
private Callback<PropertySheet.Item, PropertyEditor<?>> getItemPropertyEditorCallback(SimpleObjectProperty<Callback<PropertySheet.Item, PropertyEditor<?>>> propertyEditorFactory) {
return param -> {
PropertyEditor<?> editor = propertyEditorFactory.get().call(param);
//Add listeners to editor
editor.getEditor().focusedProperty().addListener((observable, oldValue, newValue) -> System.out.println(newValue));
return editor;
};
}