org.kuali.rice.krad.uif.modifier

Class CompareFieldCreateModifier

    • Method Detail

      • performInitialization

        public void performInitialization(Object model,
                                 Component component)
        Default performInitialization impl (does nothing) Should be called to initialize the ComponentModifier

        This 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

        Specified by:
        performInitialization in interface ComponentModifier
        Overrides:
        performInitialization in class ComponentModifierBase
        Parameters:
        model - - object instance containing the view data
        component - - Component the modifier is configured on
        See Also:
        RunComponentModifiersTask
      • performModification

        public void performModification(Object model,
                               Component component)
        Generates the comparison fields

        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

        Invoked within the configured phase of the component lifecycle. This is where the ComponentModifier should perform its work against the given Component instance
        Parameters:
        model - - top level object containing the view data
        component - - the component instance to modify
        See Also:
        RunComponentModifiersTask
      • performValueComparison

        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. If the value is different, adds script to the field on ready event to add the change icon to the field and the containing group header
        Parameters:
        group - group that contains the item and whose header will be highlighted for changes
        compareItem - the compare item being generated and to pull attribute fields from
        model - object containing the data
        compareValueObjectBindingPath - object path for the comparison item
        Returns:
        true if the value in the field represented by compareItem is equal to the comparison items value, false otherwise
      • getComparableId

        protected String getComparableId(ComparableInfo comparable,
                             int index)
        Generates an comparableId suffix for the comparable item

        If the comparableId to use if configured on the ComparableInfo it will be used, else the given integer index will be used with an underscore

        Parameters:
        comparable - comparable info to check for id suffix
        index - sequence integer
        Returns:
        id suffix
        See Also:
        ComparableInfo.getComparableId()
      • getSupportedComponents

        public 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

        Returns:
        Set component classes
      • getDefaultOrderSequence

        public int getDefaultOrderSequence()
        Indicates the starting integer sequence value to use for ComparableInfo instances that do not have the order property set
        Returns:
        default sequence starting value
      • setDefaultOrderSequence

        public void setDefaultOrderSequence(int defaultOrderSequence)
        Setter for the default sequence starting value
        Parameters:
        defaultOrderSequence -
      • isGenerateCompareHeaders

        public boolean isGenerateCompareHeaders()
        Indicates whether a 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

        Returns:
        true if the headers should be created, false if no headers should be created
      • setGenerateCompareHeaders

        public void setGenerateCompareHeaders(boolean generateCompareHeaders)
        Setter for the generate comparison headers indicator
        Parameters:
        generateCompareHeaders -
      • getHeaderFieldPrototype

        public Header getHeaderFieldPrototype()
        Prototype instance to use for creating the HeaderField for each group of comparison fields (if generateCompareHeaders is true)
        Returns:
        header field prototype
      • setHeaderFieldPrototype

        public void setHeaderFieldPrototype(Header headerFieldPrototype)
        Setter for the header field prototype
        Parameters:
        headerFieldPrototype -
      • getComparables

        public List<ComparableInfogetComparables()
        List of 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

        Returns:
        comparables to generate fields for

Copyright © 2005–2014 The Kuali Foundation. All rights reserved.