wicket.markup.html.panel
Class FeedbackPanel

java.lang.Object
  extended bywicket.Component
      extended bywicket.MarkupContainer
          extended bywicket.markup.html.WebMarkupContainer
              extended bywicket.markup.html.panel.Panel
                  extended bywicket.markup.html.panel.FeedbackPanel
All Implemented Interfaces:
IFeedback, java.io.Serializable

public class FeedbackPanel
extends Panel
implements IFeedback

A panel that displays FeedbackMessages in a list view. The maximum number of messages to show can be set with setMaxMessages().

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

Nested Class Summary
 
Nested classes inherited from class wicket.Component
Component.ComponentModelChange, Component.IVisitor, Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Component
FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4
 
Constructor Summary
FeedbackPanel(java.lang.String id)
           
 
Method Summary
protected  boolean anyErrorMessage()
          Search messages that this panel will render, and see if there is any message of level ERROR or up.
protected  boolean anyMessage()
          Search messages that this panel will render, and see if there is any message.
protected  boolean anyMessage(int level)
          Search messages that this panel will render, and see if there is any message of the given level.
protected  java.lang.String getCSSClass(FeedbackMessage message)
          Gets the css class for the given message.
protected  java.util.List getCurrentMessages()
          Gets the currently collected messages for this panel.
 boolean isVersioned()
           
protected  FeedbackMessagesModel newFeedbackMessagesModel()
          Gets a new instance of FeedbackMessagesModel to use.
protected  void onBeginRequest()
          Called when a request begins.
 void setCollectingComponent(Component collectingComponent)
          Sets the optional collecting component.
 void setMaxMessages(int maxMessages)
           
 void setSortingComparator(java.util.Comparator sortingComparator)
          Sets the comparator used for sorting the messages.
 
Methods inherited from class wicket.markup.html.panel.Panel
onRender
 
Methods inherited from class wicket.markup.html.WebMarkupContainer
getMarkupType
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getMarkupStream, internalAdd, internalBeginRequest, internalEndRequest, iterator, onComponentTagBody, remove, removeAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, debug, detachModel, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getId, getLocale, getLocalizer, getModel, getModelObject, getModelObjectAsString, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResource, getResponse, getSession, getString, getString, getString, getStyle, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnBeginRequest, internalOnEndRequest, internalOnModelChanged, internalOnModelChanging, isAncestorOf, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onComponentTag, onEndRequest, onModelChanged, onModelChanging, onSessionAttach, redirectTo, remove, render, renderComponent, renderComponentTag, rendered, replaceComponentTagBody, sameRootModel, sameRootModel, setFlag, setModelObject, setRedirect, setRenderBodyOnly, setResponsePage, setShouldEscapeModelStrings, setVersioned, setVisible, urlFor, visitParents, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeedbackPanel

public FeedbackPanel(java.lang.String id)
See Also:
Component.Component(String)
Method Detail

setMaxMessages

public final void setMaxMessages(int maxMessages)
Parameters:
maxMessages - The maximum number of feedback messages that this feedback panel should show at one time

setCollectingComponent

public final 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.

Specified by:
setCollectingComponent in interface IFeedback
Parameters:
collectingComponent - the collecting component

setSortingComparator

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

Parameters:
sortingComparator - comparator used for sorting the messages.

isVersioned

public boolean isVersioned()
Overrides:
isVersioned in class Component
Returns:
Returns the isVersioned.
See Also:
Component.isVersioned()

onBeginRequest

protected final void onBeginRequest()
Description copied from class: Component
Called when a request begins.

Overrides:
onBeginRequest in class Component
See Also:
Component.onBeginRequest()

getCSSClass

protected java.lang.String getCSSClass(FeedbackMessage message)
Gets the css class for the given message.

Parameters:
message - the message
Returns:
the css class; by default, this returns feedbackPanel + the message level, eg 'feedbackPanelERROR', but you can override this method to provide your own

newFeedbackMessagesModel

protected FeedbackMessagesModel newFeedbackMessagesModel()
Gets a new instance of FeedbackMessagesModel to use.

Returns:
instance of FeedbackMessagesModel to use

getCurrentMessages

protected final java.util.List getCurrentMessages()
Gets the currently collected messages for this panel.

Returns:
the currently collected messages for this panel, possibly empty

anyErrorMessage

protected final boolean anyErrorMessage()
Search messages that this panel will render, and see if there is any message of level ERROR or up. This is a convenience method; same as calling 'anyMessage(FeedbackMessage.ERROR)'.

Returns:
whether there is any message for this panel of level ERROR or up

anyMessage

protected final boolean anyMessage()
Search messages that this panel will render, and see if there is any message.

Returns:
whether there is any message for this panel

anyMessage

protected final boolean anyMessage(int level)
Search messages that this panel will render, and see if there is any message of the given level.

Parameters:
level - the level, see FeedbackMessage
Returns:
whether there is any message for this panel of the given level


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