public class ComponentConvertModifier extends ComponentModifierBase
Component
instance converts all component properties
of a certain type to instances of another configured Component
.
The conversion is performed recursively down all the component children
Some example uses of this are converting all checkbox controls to radio group controls within a group and replacement of a widget with another
componentCode, namespaceCode
INITIAL_ORDER_VALUE
Constructor and Description |
---|
ComponentConvertModifier() |
Modifier and Type | Method and Description |
---|---|
protected void |
convertToReplacement(Component component,
int idSuffix)
Reads the component properties and looks for types that match the
configured type to replace.
|
List<Component> |
getComponentPrototypes()
List of components that are maintained by the modifier as prototypes for creating other component instances
|
Component |
getComponentReplacementPrototype()
Prototype for the component replacement
|
Class<? extends Component> |
getComponentTypeToReplace()
Type of component that should be replaced with an instance of the
component prototype
|
Set<Class<? extends Component>> |
getSupportedComponents()
Set of Component classes that may be sent to
the modifier |
protected void |
performConversion(Component component,
String componentProperty,
int idSuffix)
Creates a new instance of the replacement component prototype and sets a
the property value for the given property name and component instance
|
void |
performModification(Object model,
Component component)
Invoked within the configured phase of the component lifecycle.
|
void |
setComponentReplacementPrototype(Component componentReplacementPrototype)
Setter for the replacement component prototype
|
void |
setComponentTypeToReplace(Class<? extends Component> componentTypeToReplace)
Setter for the component type to replace
|
getOrder, getRunCondition, getRunPhase, performInitialization, setOrder, setRunCondition, setRunPhase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
clone, copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
public ComponentConvertModifier()
public void performModification(Object model, Component component)
ComponentModifier
should perform its work against
the given Component
instancemodel
- - top level object containing the view datacomponent
- - the component instance to modifyRunComponentModifiersTask
protected void convertToReplacement(Component component, int idSuffix)
component
- component instance to inspect properties foridSuffix
- suffix string to use for any generated component
replacementsprotected void performConversion(Component component, String componentProperty, int idSuffix)
component
- component instance to set property oncomponentProperty
- property name to setidSuffix
- suffix string to use for the generated componentpublic Set<Class<? extends Component>> getSupportedComponents()
Set
of Component
classes that may be sent to
the modifier
If 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
public List<Component> getComponentPrototypes()
ComponentModifier
Prototypes 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.
getComponentPrototypes
in interface ComponentModifier
getComponentPrototypes
in class ComponentModifierBase
ComponentModifierBase.getComponentPrototypes()
public Class<? extends Component> getComponentTypeToReplace()
public void setComponentTypeToReplace(Class<? extends Component> componentTypeToReplace)
componentTypeToReplace
- public Component getComponentReplacementPrototype()
Each time the type to replace if found a new instance of the component prototype will be created and set as the new property value
public void setComponentReplacementPrototype(Component componentReplacementPrototype)
componentReplacementPrototype
- Copyright © 2005–2014 The Kuali Foundation. All rights reserved.