Class FeedbackMessagesModel

  • All Implemented Interfaces:
    java.io.Serializable, IDetachable, IModel<java.util.List<FeedbackMessage>>, org.apache.wicket.util.io.IClusterable

    public class FeedbackMessagesModel
    extends java.lang.Object
    implements IModel<java.util.List<FeedbackMessage>>
    Model for extracting feedback messages.
    Author:
    Eelco Hillenius
    See Also:
    Serialized Form
    • Constructor Detail

      • FeedbackMessagesModel

        public FeedbackMessagesModel​(Component pageResolvingComponent)
        Constructor. Creates a model for all feedback messages on the page.
        Parameters:
        pageResolvingComponent - The component where the page will be get from for which messages will be displayed usually the same page as the one feedbackpanel is attached to
      • FeedbackMessagesModel

        public FeedbackMessagesModel​(Page page,
                                     IFeedbackMessageFilter filter)
        Constructor. Creates a model for all feedback messages accepted by the given filter.
        Parameters:
        filter - The filter to apply
        page - Page for which messages will be displayed - usually the same page as the one feedbackpanel is attached to
    • Method Detail

      • getSortingComparator

        public final java.util.Comparator<FeedbackMessage> getSortingComparator()
        Returns:
        The current sorting comparator
      • collectMessages

        protected java.util.List<FeedbackMessage> collectMessages​(Component pageResolvingComponent,
                                                                  IFeedbackMessageFilter filter)
        Collects feedback messages
        Parameters:
        pageResolvingComponent -
        filter -
        Returns:
        list of feedback messages
      • setSortingComparator

        public final FeedbackMessagesModel setSortingComparator​(java.util.Comparator<FeedbackMessage> sortingComparator)
        Sets the comparator used for sorting the messages.
        Parameters:
        sortingComparator - comparator used for sorting the messages
        Returns:
        this
      • processMessages

        protected java.util.List<FeedbackMessage> processMessages​(java.util.List<FeedbackMessage> messages)
        Override this method to post process to the FeedbackMessage list.
        Parameters:
        messages - List of sorted and filtered FeedbackMessages for further processing
        Returns:
        The processed FeedbackMessage list
      • setObject

        public void setObject​(java.util.List<FeedbackMessage> object)
        Description copied from interface: IModel
        Sets the model object.
        Specified by:
        setObject in interface IModel<java.util.List<FeedbackMessage>>
        Parameters:
        object - The model object
      • detach

        public void detach()
        Description copied from interface: IDetachable
        Detaches model after use. This is generally used to null out transient references that can be re-attached later.
        Specified by:
        detach in interface IDetachable
        Specified by:
        detach in interface IModel<java.util.List<FeedbackMessage>>