Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditor.EditorValue.Propagator<T>
- Type Parameters:
T- the source attribute value type
- Enclosing interface:
EntityEditor.EditorValue<T>
public static interface EntityEditor.EditorValue.Propagator<T>
Propagates derived attribute values when a source attribute value changes.
A EntityEditor.EditorValue.Propagator provides a unified mechanism for updating associated attribute values,
replacing the need to separately handle value propagation in the editor
(via EntityEditor.EditorValue.edited() listeners) and in entities (via overriding).
The EntityEditor.EditorValue.Propagator.Setter provided to propagate(Object, Setter) routes to the
appropriate target depending on context:
- When editing via the editor (
Value.set(Object)), values are set via the respectiveEntityEditor.EditorValueinstances, triggering edit events. - When setting values in an entity (
EntityEditor.EditorValue.set(Entity, Object)), values are set directly on the entity viaEntity.set(Attribute, Object).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSets attribute values, routing to the appropriate target depending on context. -
Method Summary
Modifier and TypeMethodDescriptionvoidpropagate(@Nullable T value, EntityEditor.EditorValue.Propagator.Setter setter) Propagates derived values based on the given source attribute value.
-
Method Details
-
propagate
Propagates derived values based on the given source attribute value.- Parameters:
value- the new source attribute value, may be nullsetter- the setter to use when setting derived attribute values
-