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

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by org.apache.cocoon.faces.samples.components.components.AreaComponent
All Implemented Interfaces:
javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class AreaComponent
extends javax.faces.component.UIOutput

AreaComponent is a JavaServer Faces component that represents a particular hotspot in a client-side image map defined by our parent MapComponent. The valueRef property (if present) must point at a JavaBean of type org.apache.cocoon.faces.samples.components.model.ImageArea; if not present, an ImageArea instance will be synthesized from the values of the alt, coords, and shape properties, and assigned to the value property.


Field Summary
 
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY, COMPONENT_TYPE
 
Constructor Summary
AreaComponent()
           
 
Method Summary
 String getAlt()
          Return the alternate text for our synthesized ImageArea.
 String getCoords()
          Return the hotspot coordinates for our synthesized ImageArea.
 String getFamily()
          Return the component family for this component.
 String getShape()
          Return the shape for our synthesized ImageArea.
 String getTargetImage()
          Set the image that is the target of this AreaComponent.
 Object getValue()
          Synthesize and return an ImageArea bean for this hotspot, if there is no valueRef property on this component.
 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 setAlt(String alt)
          Set the alternate text for our synthesized ImageArea.
 void setCoords(String coords)
          Set the hotspot coordinates for our synthesized ImageArea.
 void setShape(String shape)
          Set the shape for our synthesized ImageArea.
 void setTargetImage(String targetImage)
          Set the image that is the target of this AreaComponent.
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, 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, getPathToComponent, 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
 

Constructor Detail

AreaComponent

public AreaComponent()
Method Detail

getAlt

public String getAlt()

Return the alternate text for our synthesized ImageArea.


setAlt

public void setAlt(String alt)

Set the alternate text for our synthesized ImageArea.

Parameters:
alt - The new alternate text

getCoords

public String getCoords()

Return the hotspot coordinates for our synthesized ImageArea.


setCoords

public void setCoords(String coords)

Set the hotspot coordinates for our synthesized ImageArea.

Parameters:
coords - The new coordinates

getShape

public String getShape()

Return the shape for our synthesized ImageArea.


setShape

public void setShape(String shape)

Set the shape for our synthesized ImageArea.

Parameters:
shape - The new shape (default, rect, circle, poly)

getTargetImage

public String getTargetImage()

Set the image that is the target of this AreaComponent.

Returns:
the target image of this area component.

setTargetImage

public void setTargetImage(String targetImage)

Set the image that is the target of this AreaComponent.

Parameters:
targetImage - the ID of the target of this AreaComponent

getFamily

public String getFamily()

Return the component family for this component.

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

getValue

public Object getValue()

Synthesize and return an ImageArea bean for this hotspot, if there is no valueRef property on this component.

Specified by:
getValue in interface javax.faces.component.ValueHolder
Overrides:
getValue in class javax.faces.component.UIOutput

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.UIOutput
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.UIOutput
Parameters:
context - FacesContext for the current request
state - State to be restored


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