wicket
Class FeedbackMessages

java.lang.Object
  extended bywicket.FeedbackMessages
All Implemented Interfaces:
java.io.Serializable

public final class FeedbackMessages
extends java.lang.Object
implements java.io.Serializable

Structure for recording FeedbackMessages; wraps a list and acts as a IModel.

Author:
Eelco Hillenius, Jonathan Locke
See Also:
Serialized Form

Method Summary
 void clear()
          Clears any existing messages
 boolean hasErrorMessageFor(Component component)
          Convenience method that looks up whether the given component registered a message with this list with the level ERROR.
 boolean hasMessageFor(Component component)
          Looks up whether the given component registered a message with this list.
 boolean hasMessageFor(Component component, int level)
          Looks up whether the given component registered a message with this list with the given level.
 boolean isEmpty()
          Gets whether there are no messages.
 FeedbackMessage messageForComponent(Component component)
          Looks up a message for the given component.
 java.util.List messages(Component component, boolean recurse, boolean stopAtBoundary, int fromLevel)
          Gets the list of messages relevant to a given component.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

clear

public final void clear()
Clears any existing messages


isEmpty

public final boolean isEmpty()
Gets whether there are no messages.

Returns:
True when there are no messages

hasErrorMessageFor

public final boolean hasErrorMessageFor(Component component)
Convenience method that looks up whether the given component registered a message with this list with the level ERROR.

Parameters:
component - the component to look up whether it registered a message
Returns:
whether the given component registered a message with this list with level ERROR

hasMessageFor

public final boolean hasMessageFor(Component component)
Looks up whether the given component registered a message with this list.

Parameters:
component - the component to look up whether it registered a message
Returns:
whether the given component registered a message with this list

hasMessageFor

public final boolean hasMessageFor(Component component,
                                   int level)
Looks up whether the given component registered a message with this list with the given level.

Parameters:
component - The component to look up whether it registered a message
level - The level of the message
Returns:
Whether the given component registered a message with this list with the given level

messageForComponent

public final FeedbackMessage messageForComponent(Component component)
Looks up a message for the given component.

Parameters:
component - the component to look up the message for
Returns:
the message that is found for the given component (first match) or null if none was found

messages

public final java.util.List messages(Component component,
                                     boolean recurse,
                                     boolean stopAtBoundary,
                                     int fromLevel)
Gets the list of messages relevant to a given component. If the component is a container, the list returned will be a list of all messages reported by children of the container.

Parameters:
component - The component to get messages for
recurse - True if children of the component should be considered
stopAtBoundary - whether to stop collecting messages when a child component is of type IFeedbackBoundary. Only has effect when recurse == true.
fromLevel - from which level the messages are collected; DEBUG traps all, but e.g. ERROR only traps ERROR and FATAL
Returns:
The messages or an empty list when no messages are found

toString

public java.lang.String toString()
See Also:
Object.toString()


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