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
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.
|
protected <T> void |
copyProperties(T componentModifier)
Copies the properties over for the copy method
|
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(View view,
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, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
copy, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copy
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
getComponentCode, getNamespaceCode
public ComponentConvertModifier()
public void performModification(View view, Object model, Component component)
ComponentModifier
ComponentModifier
should perform its work against
the given Component
instanceview
- - the view instance to which the component belongsmodel
- - top level object containing the view datacomponent
- - the component instance to modifyComponentModifier.performModification(org.kuali.rice.krad.uif.view.View,
java.lang.Object, org.kuali.rice.krad.uif.component.Component)
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()
ComponentModifier
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
ComponentModifier.getSupportedComponents()
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
- protected <T> void copyProperties(T componentModifier)
ComponentModifierBase
copyProperties
in class ComponentModifierBase
componentModifier
- base beanDictionaryBeanBase.copy()
Copyright © 2005-2015 The Kuali Foundation. All Rights Reserved.