org.apache.wicket.feedback
Class FeedbackMessagesModel

java.lang.Object
  extended by org.apache.wicket.feedback.FeedbackMessagesModel
All Implemented Interfaces:
java.io.Serializable, IClusterable, IDetachable, IModel

public class FeedbackMessagesModel
extends java.lang.Object
implements IModel

Model for extracting feedback messages.

Author:
Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
FeedbackMessagesModel(Component component)
          Constructor.
FeedbackMessagesModel(Page page, IFeedbackMessageFilter filter)
          Constructor.
 
Method Summary
 void detach()
          Detaches model after use.
 IFeedbackMessageFilter getFilter()
           
 java.lang.Object getObject()
          Gets the model object.
 java.util.Comparator getSortingComparator()
           
protected  java.util.List processMessages(java.util.List messages)
          Override this method to post process to the FeedbackMessage list.
 FeedbackMessagesModel setFilter(IFeedbackMessageFilter filter)
           
 void setObject(java.lang.Object object)
          Sets the model object.
 FeedbackMessagesModel setSortingComparator(java.util.Comparator sortingComparator)
          Sets the comparator used for sorting the messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedbackMessagesModel

public FeedbackMessagesModel(Component component)
Constructor. Creates a model for all feedback messages on the page.

Parameters:
component - 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

getFilter

public final IFeedbackMessageFilter getFilter()
Returns:
The current message filter

getSortingComparator

public final java.util.Comparator getSortingComparator()
Returns:
The current sorting comparator

getObject

public final java.lang.Object getObject()
Description copied from interface: IModel
Gets the model object.

Specified by:
getObject in interface IModel
Returns:
The model object
See Also:
IModel.getObject()

setFilter

public final FeedbackMessagesModel setFilter(IFeedbackMessageFilter filter)
Parameters:
filter - Filter to apply to model
Returns:
this

setSortingComparator

public final FeedbackMessagesModel setSortingComparator(java.util.Comparator sortingComparator)
Sets the comparator used for sorting the messages.

Parameters:
sortingComparator - comparator used for sorting the messages
Returns:
this

processMessages

protected java.util.List processMessages(java.util.List 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.lang.Object object)
Description copied from interface: IModel
Sets the model object.

Specified by:
setObject in interface IModel
Parameters:
object - The model object
See Also:
IModel.setObject(java.lang.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
See Also:
IDetachable.detach()


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.