org.apache.cocoon.faces.samples.components.components
Class MapComponent

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UICommand
              extended byorg.apache.cocoon.faces.samples.components.components.MapComponent
All Implemented Interfaces:
javax.faces.component.ActionSource, javax.faces.component.StateHolder

public class MapComponent
extends javax.faces.component.UICommand

MapComponent is a JavaServer Faces component that corresponds to a client-side image map. It can have one or more children of type AreaComponent, each representing hot spots, which a user can click on and mouse over.

This component is a source of AreaSelectedEvent events, which are fired whenever the current area is changed.


Field Summary
 
Fields inherited from class javax.faces.component.UICommand
COMPONENT_FAMILY, COMPONENT_TYPE
 
Constructor Summary
MapComponent()
           
 
Method Summary
 void broadcast(javax.faces.event.FacesEvent event)
          In addition to to the default UIComponentBase#broadcast processing, pass the ActionEvent being broadcast to the method referenced by actionListener (if any).
 String getCurrent()
          Return the alternate text label for the currently selected child AreaComponent.
 String getFamily()
          Return the component family for this component.
 void queueEvent(javax.faces.event.FacesEvent e)
          Intercept queueEvent and mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise.
 void restoreState(javax.faces.context.FacesContext context, Object state)
          Restore the state for this component.
 Object saveState(javax.faces.context.FacesContext context)
          Return the state to be saved for this component.
 void setCurrent(String current)
          Set the alternate text label for the currently selected child.
 
Methods inherited from class javax.faces.component.UICommand
addActionListener, getAction, getActionListener, getActionListeners, getValue, isImmediate, removeActionListener, setAction, setActionListener, setImmediate, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, 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, 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
 

Constructor Detail

MapComponent

public MapComponent()
Method Detail

getCurrent

public String getCurrent()

Return the alternate text label for the currently selected child AreaComponent.


setCurrent

public void setCurrent(String current)

Set the alternate text label for the currently selected child. If this is different from the previous value, fire an AreaSelectedEvent to interested listeners.

Parameters:
current - The new alternate text label

getFamily

public String getFamily()

Return the component family for this component.


broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException

In addition to to the default UIComponentBase#broadcast processing, pass the ActionEvent being broadcast to the method referenced by actionListener (if any).

Parameters:
event - FacesEvent to be broadcast
Throws:
javax.faces.event.AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
IllegalArgumentException - if the implementation class of this FacesEvent is not supported by this component
IllegalStateException - if PhaseId.ANY_PHASE is passed for the phase identifier
NullPointerException - if event is null

queueEvent

public void queueEvent(javax.faces.event.FacesEvent e)

Intercept queueEvent and mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise.


saveState

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

Return the state to be saved for this component.

Parameters:
context - FacesContext for the current request

restoreState

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

Restore the state for this component.

Parameters:
context - FacesContext for the current request
state - State to be restored
Throws:
IOException - if an input/output error occurs


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.