|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.uif.component.ConfigurableBase org.kuali.rice.krad.uif.modifier.ComponentModifierBase org.kuali.rice.krad.uif.modifier.ComponentConvertModifier
public class ComponentConvertModifier
For a given 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
Field Summary |
---|
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered |
---|
INITIAL_ORDER_VALUE |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
ComponentConvertModifier()
|
Method Summary | |
---|---|
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(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 |
Methods inherited from class org.kuali.rice.krad.uif.modifier.ComponentModifierBase |
---|
getOrder, getRunCondition, getRunPhase, performInitialization, setOrder, setRunCondition, setRunPhase |
Methods inherited from class org.kuali.rice.krad.uif.component.ConfigurableBase |
---|
getPropertyExpression, getPropertyExpressions, setPropertyExpressions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.kuali.rice.krad.uif.component.Configurable |
---|
getPropertyExpression, getPropertyExpressions, setPropertyExpressions |
Constructor Detail |
---|
public ComponentConvertModifier()
Method Detail |
---|
public void performModification(View view, Object model, Component component)
ComponentModifier
ComponentModifier
should perform its work against
the given Component
instance
view
- - 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
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |