wicket.markup.html.panel
Class FeedbackPanel

java.lang.Object
  extended by wicket.Component
      extended by wicket.MarkupContainer
          extended by wicket.markup.html.WebMarkupContainer
              extended by wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
                  extended by wicket.markup.html.panel.Panel
                      extended by wicket.markup.html.panel.FeedbackPanel
All Implemented Interfaces:
java.io.Serializable, IFeedback
Direct Known Subclasses:
ComponentFeedbackPanel

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/interfaces inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
WebMarkupContainerWithAssociatedMarkup.HeaderPartContainer
 
Nested classes/interfaces inherited from class wicket.Component
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Constructor Summary
FeedbackPanel(java.lang.String id)
           
FeedbackPanel(java.lang.String id, IFeedbackMessageFilter filter)
           
 
Method Summary
 boolean anyErrorMessage()
          Search messages that this panel will render, and see if there is any message of level ERROR or up.
 boolean anyMessage()
          Search messages that this panel will render, and see if there is any message.
 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 getEscapeMessages()
          Gets whether model messages should be HTML escaped.
 FeedbackMessagesModel getFeedbackMessagesModel()
           
 IFeedbackMessageFilter getFilter()
           
 java.util.Comparator getSortingComparator()
           
 boolean isVersioned()
           
protected  FeedbackMessagesModel newFeedbackMessagesModel()
          Gets a new instance of FeedbackMessagesModel to use.
 void setEscapeMessages(boolean escapeMessages)
          Sets whether model messages should be HTML escaped.
 void setFilter(IFeedbackMessageFilter filter)
          Sets a filter to use on the feedback messages model
 void setMaxMessages(int maxMessages)
           
 void setSortingComparator(java.util.Comparator sortingComparator)
          Sets the comparator used for sorting the messages.
 void updateFeedback()
          This method is called on any component implementing IFeedback when it is time for the component to update its feedback display
 
Methods inherited from class wicket.markup.html.panel.Panel
onComponentTag, onComponentTagBody, renderHead
 
Methods inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile
 
Methods inherited from class wicket.markup.html.WebMarkupContainer
getMarkupType, getWebPage
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, continueToOriginalDestination, debug, detachBehaviors, detachModel, detachModels, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getOutputMarkupId, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isBehaviorAccepted, isEnableAllowed, isEnabled, isHeadRendered, isIgnoreAttributeModifier, isRenderAllowed, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onDetach, onEndRequest, onModelChanged, onModelChanging, onRender, redirectToInterceptPage, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderedBehaviors, replaceComponentTagBody, replaceWith, resetHeadRendered, sameRootModel, sameRootModel, setAuto, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMetaData, setModelObject, setOutputMarkupId, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, 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)

FeedbackPanel

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

getEscapeMessages

public final boolean getEscapeMessages()
Gets whether model messages should be HTML escaped. Default is true.

Returns:
whether model messages should be HTML escaped

getFeedbackMessagesModel

public final FeedbackMessagesModel getFeedbackMessagesModel()
Returns:
Model for feedback messages on which you can install filters and other properties

getFilter

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

getSortingComparator

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

isVersioned

public boolean isVersioned()
Overrides:
isVersioned in class Component
Returns:
True if this component is versioned
See Also:
Component.isVersioned()

setEscapeMessages

public final void setEscapeMessages(boolean escapeMessages)
Sets whether model messages should be HTML escaped. Default is true.

Parameters:
escapeMessages - whether model messages should be HTML escaped

setFilter

public final void setFilter(IFeedbackMessageFilter filter)
Sets a filter to use on the feedback messages model

Parameters:
filter - The message filter to install on the feedback messages model

setMaxMessages

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

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.

updateFeedback

public void updateFeedback()
Description copied from interface: IFeedback
This method is called on any component implementing IFeedback when it is time for the component to update its feedback display

Specified by:
updateFeedback in interface IFeedback
See Also:
IFeedback.updateFeedback()

anyErrorMessage

public 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

public 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

public 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

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

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

newFeedbackMessagesModel

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

Returns:
Instance of FeedbackMessagesModel to use


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