org.apache.struts.faces.component
Class MessageComponent

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIOutput
              extended byorg.apache.struts.faces.component.MessageComponent
All Implemented Interfaces:
javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class MessageComponent
extends javax.faces.component.UIOutput

Custom component that replaces the Struts <html:message> tag.


Field Summary
private  java.lang.String bundle
          MessageResources attribute key to use for message lookup.
private  boolean filter
          Flag indicating whether output should be filtered.
private  boolean filterSet
           
private  java.lang.String key
          Message key to use for message lookup.
private  java.lang.String style
          CSS style(s) to be rendered for this component.
private  java.lang.String styleClass
          CSS style class(es) to be rendered for this component.
 
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from class javax.faces.component.UIComponentBase
 
Constructor Summary
MessageComponent()
          Create a new MessageComponent with default properties.
 
Method Summary
 java.lang.String getBundle()
          Return the MessageResources key.
 java.lang.String getFamily()
          Return the component family to which this component belongs.
 java.lang.String getKey()
          Return the message key.
 java.lang.String getStyle()
          Return the CSS style(s) to be rendered for this component.
 java.lang.String getStyleClass()
          Return the CSS style class(es) to be rendered for this component.
 boolean isFilter()
          Return a flag indicating whether filtering should take place.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
          Save the state of this component.
 void setBundle(java.lang.String bundle)
          Set the MessageResources key.
 void setFilter(boolean filter)
          Set the flag indicating that the output value should be filtered.
 void setKey(java.lang.String key)
          Set the message key.
 void setStyle(java.lang.String style)
          Set the CSS style(s) to be rendered for this component.
 void setStyleClass(java.lang.String styleClass)
          Set the CSS style class(es) to be rendered for this component.
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bundle

private java.lang.String bundle

MessageResources attribute key to use for message lookup.


filter

private boolean filter

Flag indicating whether output should be filtered.


filterSet

private boolean filterSet

key

private java.lang.String key

Message key to use for message lookup.


style

private java.lang.String style

CSS style(s) to be rendered for this component.


styleClass

private java.lang.String styleClass

CSS style class(es) to be rendered for this component.

Constructor Detail

MessageComponent

public MessageComponent()

Create a new MessageComponent with default properties.

Method Detail

getBundle

public java.lang.String getBundle()

Return the MessageResources key.


setBundle

public void setBundle(java.lang.String bundle)

Set the MessageResources key.

Parameters:
bundle - The new key

getFamily

public java.lang.String getFamily()

Return the component family to which this component belongs.


isFilter

public boolean isFilter()

Return a flag indicating whether filtering should take place.


setFilter

public void setFilter(boolean filter)

Set the flag indicating that the output value should be filtered.

Parameters:
filter - The new filter flag

getKey

public java.lang.String getKey()

Return the message key.


setKey

public void setKey(java.lang.String key)

Set the message key.

Parameters:
key - The new key

getStyle

public java.lang.String getStyle()

Return the CSS style(s) to be rendered for this component.


setStyle

public void setStyle(java.lang.String style)

Set the CSS style(s) to be rendered for this component.

Parameters:
style - The new CSS style(s)

getStyleClass

public java.lang.String getStyleClass()

Return the CSS style class(es) to be rendered for this component.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

Set the CSS style class(es) to be rendered for this component.

Parameters:
styleClass - The new CSS style class(es)

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)

Restore the state of this component.

Parameters:
context - FacesContext for the current request
state - State object from which to restore our state

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)

Save the state of this component.

Parameters:
context - FacesContext for the current request


Copyright ? 2003-2004 - The Apache Software Foundation