|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.datadictionary.DictionaryBeanBase org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase org.kuali.rice.krad.uif.modifier.ComponentModifierBase org.kuali.rice.krad.uif.modifier.CompareFieldCreateModifier
public class CompareFieldCreateModifier
Generates Field
instances to produce a comparison view among
objects of the same type
Modifier is initialized with a List of ComparableInfo
instances.
For each comparable info, a copy of the configured group field is made and
adjusted to the binding object path for the comparable. The comparison fields
are ordered based on the configured order property of the comparable. In
addition, a HeaderField
can be generated to label each group
of comparison fields.
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 | |
---|---|
CompareFieldCreateModifier()
|
Method Summary | |
---|---|
List<ComparableInfo> |
getComparables()
List of ComparableInfo instances the compare fields should
be generated for |
List<Component> |
getComponentPrototypes()
List of components that are maintained by the modifier as prototypes for creating other component instances |
int |
getDefaultOrderSequence()
Indicates the starting integer sequence value to use for ComparableInfo instances that do not have the order property
set |
Header |
getHeaderFieldPrototype()
Prototype instance to use for creating the HeaderField for
each group of comparison fields (if generateCompareHeaders is true) |
protected String |
getIdSuffix(ComparableInfo comparable,
int index)
Generates an id suffix for the comparable item |
Set<Class<? extends Component>> |
getSupportedComponents()
Set of Component classes that may be sent to
the modifier |
boolean |
isGenerateCompareHeaders()
Indicates whether a HeaderField should be created for each
group of comparison fields |
void |
performInitialization(View view,
Object model,
Component component)
Calls ViewHelperService to initialize the header field prototype |
void |
performModification(View view,
Object model,
Component component)
Generates the comparison fields |
protected boolean |
performValueComparison(Group group,
Component compareItem,
Object model,
String compareValueObjectBindingPath)
For each attribute field in the compare item, retrieves the field value and compares against the value for the main comparable. |
void |
setComparables(List<ComparableInfo> comparables)
Setter for the list of comparable info instances |
void |
setDefaultOrderSequence(int defaultOrderSequence)
Setter for the default sequence starting value |
void |
setGenerateCompareHeaders(boolean generateCompareHeaders)
Setter for the generate comparison headers indicator |
void |
setHeaderFieldPrototype(Header headerFieldPrototype)
Setter for the header field prototype |
Methods inherited from class org.kuali.rice.krad.uif.modifier.ComponentModifierBase |
---|
getOrder, getRunCondition, getRunPhase, setOrder, setRunCondition, setRunPhase |
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph |
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase |
---|
getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode |
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.datadictionary.uif.UifDictionaryBean |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph |
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean |
---|
getComponentCode, getNamespaceCode |
Constructor Detail |
---|
public CompareFieldCreateModifier()
Method Detail |
---|
public void performInitialization(View view, Object model, Component component)
ViewHelperService
to initialize the header field prototype
performInitialization
in interface ComponentModifier
performInitialization
in class ComponentModifierBase
view
- - View instance the component modifier is a part ofcomponent
- - Component the modifier is configured onComponentModifier.performInitialization(org.kuali.rice.krad.uif.view.View,
java.lang.Object, org.kuali.rice.krad.uif.component.Component)
public void performModification(View view, Object model, Component component)
First the configured List of ComparableInfo
instances are
sorted based on their order property. Then if generateCompareHeaders is
set to true, a HeaderField
is created for each comparable
using the headerFieldPrototype and the headerText given by the
comparable. Finally for each field configured on the Group
,
a corresponding comparison field is generated for each comparable and
adjusted to the binding object path given by the comparable in addition
to suffixing the id and setting the readOnly property
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 boolean performValueComparison(Group group, Component compareItem, Object model, String compareValueObjectBindingPath)
group
- - group that contains the item and whose header will be highlighted for changescompareItem
- - the compare item being generated and to pull attribute fields frommodel
- - object containing the datacompareValueObjectBindingPath
- - object path for the comparison item
protected String getIdSuffix(ComparableInfo comparable, int index)
If the idSuffix to use if configured on the ComparableInfo
it will be used, else the given integer index will be used with an
underscore
comparable
- - comparable info to check for id suffixindex
- - sequence integer
ComparableInfo.getIdSuffix()
public 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 int getDefaultOrderSequence()
ComparableInfo
instances that do not have the order property
set
public void setDefaultOrderSequence(int defaultOrderSequence)
defaultOrderSequence
- public boolean isGenerateCompareHeaders()
HeaderField
should be created for each
group of comparison fields
If set to true, for each group of comparison fields a header field will be created using the headerFieldPrototype configured on the modifier with the headerText property of the comparable
public void setGenerateCompareHeaders(boolean generateCompareHeaders)
generateCompareHeaders
- public Header getHeaderFieldPrototype()
HeaderField
for
each group of comparison fields (if generateCompareHeaders is true)
public void setHeaderFieldPrototype(Header headerFieldPrototype)
headerFieldPrototype
- public List<ComparableInfo> getComparables()
ComparableInfo
instances the compare fields should
be generated for
For each comparable, a copy of the fields configured for the
Group
will be created for the comparison view
public void setComparables(List<ComparableInfo> comparables)
comparables
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |