Interface ComponentModifier
- All Superinterfaces:
DictionaryBean,Ordered,org.springframework.core.Ordered,Serializable,UifDictionaryBean
- All Known Implementing Classes:
CompareFieldCreateModifier,ComponentConvertModifier,ComponentModifierBase,LabelSeparateModifier
Component
ComponentModifier instances are configured by the component's
dictionary definition. They can be used to provide dynamic initialization
behavior for a certain type of component or all components based on the
getComponentsForLifecycle method. In addition they can do dynamic generation of
new Component instances, or replacement of the components or
their properties.
Modifiers provide for more usability and flexibility of component
configuration. For instance if a Group definition is already
configured that is close to what the developer needs, but they need to make
global changes of the group, then can invoke or create a
ComponentModifier for the group to apply those changes. The
configuration can then inherit the exiting group definition and then specify
the modifier to run with the component's componentModifiers property.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionList of components that are maintained by the modifier as prototypes for creating other component instancesintgetOrder()Conditional expression to evaluate for determining whether the component modifier should be run.Indicates what phase of the component lifecycle theComponentModifiershould be invoked in (INITIALIZE, APPLY_MODEL, or FINALIZE)SetofComponentclasses that may be sent to the modifiervoidperformInitialization(Object model, Component component) Should be called to initialize the ComponentModifiervoidperformModification(Object model, Component component) Invoked within the configured phase of the component lifecycle.voidsetOrder(int order) Setter for the order valueMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCodeMethods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
-
Method Details
-
performInitialization
Should be called to initialize the ComponentModifierThis is where component modifiers can set defaults and setup other necessary state. The initialize method should only be called once per layout manager lifecycle and is invoked within the initialize phase of the view lifecylce.
Note if the component modifier holds nested components, they should be initialized in this method by calling the view helper service
- Parameters:
model- - object instance containing the view datacomponent- - Component the modifier is configured on- See Also:
-
performModification
Invoked within the configured phase of the component lifecycle. This is where theComponentModifiershould perform its work against the givenComponentinstance- Parameters:
model- - top level object containing the view datacomponent- - the component instance to modify- See Also:
-
getSupportedComponents
SetofComponentclasses that may be sent to the modifierIf an empty or null list is returned, it is assumed the modifier supports all components. The returned set will be used by the dictionary validation
- Returns:
- Set component classes
-
getComponentPrototypes
List of components that are maintained by the modifier as prototypes for creating other component instancesPrototypes are held for configuring how a component should be created during the lifecycle. An example of this are the fields in a collection group that are created for each collection record. They only participate in the initialize phase.
- Returns:
- List<Component> child component prototypes
-
getRunPhase
String getRunPhase()Indicates what phase of the component lifecycle theComponentModifiershould be invoked in (INITIALIZE, APPLY_MODEL, or FINALIZE)- Returns:
- String view lifecycle phase
- See Also:
-
getRunCondition
String getRunCondition()Conditional expression to evaluate for determining whether the component modifier should be run. If the expression evaluates to true the modifier will be executed, otherwise it will not be executed- Returns:
- String el expression that should evaluate to boolean
-
getOrder
int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- See Also:
-
setOrder
void setOrder(int order) Description copied from interface:OrderedSetter for the order value
-