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

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UICommand
              extended by org.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, getPathToComponent, 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.

Overrides:
getFamily in class javax.faces.component.UICommand

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).

Overrides:
broadcast in class javax.faces.component.UICommand
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.

Overrides:
queueEvent in class javax.faces.component.UICommand

saveState

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

Return the state to be saved for this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UICommand
Parameters:
context - FacesContext for the current request

restoreState

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

Restore the state for this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UICommand
Parameters:
context - FacesContext for the current request
state - State to be restored


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.