org.apache.myfaces.custom.renderOne
Class AbstractUIRenderOne

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.custom.renderOne.AbstractUIRenderOne
All Implemented Interfaces:
javax.faces.component.StateHolder

public abstract class AbstractUIRenderOne
extends javax.faces.component.UIComponentBase

Tag that allows rendering the first child either by index or the first rendered one.

A component that only renders the first child either by index or the first visible one..

Version:
$Revision: 676950 $ $Date: 2008-07-15 19:09:46 +0300 (Tue, 15 Jul 2008) $
Author:
Andrew Robinson (latest modification by $Author: skitching $)

Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
AbstractUIRenderOne()
           
 
Method Summary
 void encodeChildren(javax.faces.context.FacesContext context)
           
 boolean getRendersChildren()
           
abstract  java.lang.String getType()
          The filter type: first|index.
abstract  java.lang.Integer getValue()
          The value valid for the type.
protected  java.lang.Object selectFirstChildByIndex(java.lang.Integer value)
           
protected  java.lang.Object selectFirstChildOnly()
           
protected  java.lang.Object selectOneChild()
           
abstract  void setType(java.lang.String type)
           
abstract  void setValue(java.lang.Integer value)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getFamily, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractUIRenderOne

public AbstractUIRenderOne()
Method Detail

getType

public abstract java.lang.String getType()
The filter type: first|index. first: the first list value should evaluate to a Number or a value that can be parsed into an integer. index: A collection, array or comma-separated list of numbers. (Default: "first")

Returns:
the type

setType

public abstract void setType(java.lang.String type)
Parameters:
type - the type to set

getValue

public abstract java.lang.Integer getValue()
The value valid for the type. If this evaluates to null, the first child will be rendered. If the type is "first", this value will be ignored, as "first" always renders the first rendered item. If the type is "index", the value must be a number.

Returns:
the value

setValue

public abstract void setValue(java.lang.Integer value)
Parameters:
value - the value to set

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.component.UIComponentBase
See Also:
UIComponentBase.getRendersChildren()

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context)
                    throws java.io.IOException
Overrides:
encodeChildren in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException
See Also:
UIComponentBase.encodeChildren(javax.faces.context.FacesContext)

selectOneChild

protected java.lang.Object selectOneChild()

selectFirstChildOnly

protected java.lang.Object selectFirstChildOnly()

selectFirstChildByIndex

protected java.lang.Object selectFirstChildByIndex(java.lang.Integer value)


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.