wicket
Class FeedbackMessagesModel

java.lang.Object
  extended bywicket.model.AbstractDetachableModel
      extended bywicket.FeedbackMessagesModel
All Implemented Interfaces:
IDetachable, IModel, java.io.Serializable

public final class FeedbackMessagesModel
extends AbstractDetachableModel

Model for extracting feedback messages.

Author:
Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
FeedbackMessagesModel(boolean includeNestedComponents)
          Construct.
FeedbackMessagesModel(boolean includeNestedComponents, Component collectingComponent)
          Construct.
FeedbackMessagesModel(boolean includeNestedComponents, Component collectingComponent, java.util.Comparator sortingComparator)
          Construct.
 
Method Summary
 IModel getNestedModel()
          Gets the nested model.
protected  void onAttach()
          Attaches to the current request.
protected  void onDetach()
          Detaches from the current request.
 java.lang.Object onGetObject(Component component)
          Called when getObject is called in order to retrieve the detachable object.
protected  void onSetObject(Component component, java.lang.Object object)
          Called when setObject is called in order to change the detachable object.
 void setCollectingComponent(Component collectingComponent)
          Sets the optional collecting component.
 void setSortingComparator(java.util.Comparator sortingComparator)
          Sets the comparator used for sorting the messages.
protected  void sort(java.util.List list)
          Sorts the list if property sortingComparator was set, otherwise it doesn't do any sorting.
 
Methods inherited from class wicket.model.AbstractDetachableModel
attach, detach, getObject, isAttached, setObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedbackMessagesModel

public FeedbackMessagesModel(boolean includeNestedComponents)
Construct. The first occurence of IFeedbackBoundary will be searched for higher up in the run-time hierarchy for collecting messages

Parameters:
includeNestedComponents - Whether to include the messages of any nested component

FeedbackMessagesModel

public FeedbackMessagesModel(boolean includeNestedComponents,
                             Component collectingComponent)
Construct.

Parameters:
includeNestedComponents - Whether to include the messages of any nested component
collectingComponent - Optional collecting component. When this is not set explicitly, the first occurence of IFeedbackBoundary will be searched for higher up in the run-time hierarchy.

FeedbackMessagesModel

public FeedbackMessagesModel(boolean includeNestedComponents,
                             Component collectingComponent,
                             java.util.Comparator sortingComparator)
Construct.

Parameters:
includeNestedComponents - Whether to include the messages of any nested component
collectingComponent - Optional collecting component. When this is not set explicitly, the first occurence of IFeedbackBoundary will be searched for higher up in the run-time hierarchy.
sortingComparator -
Method Detail

onGetObject

public java.lang.Object onGetObject(Component component)
Description copied from class: AbstractDetachableModel
Called when getObject is called in order to retrieve the detachable object. Before this method is called, getObject() always calls attach() to ensure that the object is attached.

Specified by:
onGetObject in class AbstractDetachableModel
Parameters:
component - The component asking for the object
Returns:
The object
See Also:
AbstractDetachableModel.onGetObject(wicket.Component)

sort

protected void sort(java.util.List list)
Sorts the list if property sortingComparator was set, otherwise it doesn't do any sorting.

Parameters:
list - list to sort; contains elements of FeedbackMessage.

onDetach

protected void onDetach()
Description copied from class: AbstractDetachableModel
Detaches from the current request. Implement this method with custom behaviour, such as setting the model object to null.

Specified by:
onDetach in class AbstractDetachableModel
See Also:
AbstractDetachableModel.onDetach()

onAttach

protected void onAttach()
Description copied from class: AbstractDetachableModel
Attaches to the current request. Implement this method with custom behaviour, such as loading the model object.

Specified by:
onAttach in class AbstractDetachableModel
See Also:
AbstractDetachableModel.onAttach()

onSetObject

protected void onSetObject(Component component,
                           java.lang.Object object)
Description copied from class: AbstractDetachableModel
Called when setObject is called in order to change the detachable object. Before this method is called, setObject() always calls attach() to ensure that the object is attached.

Specified by:
onSetObject in class AbstractDetachableModel
Parameters:
component - The component asking for replacement of the model object
object - The new model object
See Also:
AbstractDetachableModel.onSetObject(wicket.Component, java.lang.Object)

getNestedModel

public IModel getNestedModel()
Description copied from interface: IModel
Gets the nested model.

Specified by:
getNestedModel in interface IModel
Specified by:
getNestedModel in class AbstractDetachableModel
See Also:
IModel.getNestedModel()

setCollectingComponent

public void setCollectingComponent(Component collectingComponent)
Sets the optional collecting component. When this is not set explicitly, the first occurence of IFeedbackBoundary will be searched for higher up in the run-time hierarchy.

Parameters:
collectingComponent - the collecting component

setSortingComparator

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

Parameters:
sortingComparator - comparator used for sorting the messages


Copyright © 2004-2005 Wicket developers. All Rights Reserved.