org.apache.myfaces.trinidadinternal.renderkit.core.xhtml
Class LabelAndMessageRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.trinidad.render.CoreRenderer
          extended by org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer
              extended by org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer
All Implemented Interfaces:
java.lang.Cloneable, org.apache.myfaces.trinidad.render.TypedRenderer
Direct Known Subclasses:
InputLabelAndMessageRenderer, PanelLabelAndMessageRenderer

public abstract class LabelAndMessageRenderer
extends XhtmlRenderer


Field Summary
static java.lang.String INLINE_MESSAGE_DEFAULT_GAP
           
static java.lang.String INLINE_MESSAGE_PDA_GAP
           
 
Fields inherited from class org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer
TRANSPARENT_GIF
 
Fields inherited from class org.apache.myfaces.trinidad.render.CoreRenderer
CHAR_UNDEFINED, NO_CHILD_INDEX
 
Constructor Summary
LabelAndMessageRenderer(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
           
 
Method Summary
protected  void encodeAll(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  void findTypeConstants(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
           
protected  java.lang.String getClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Returns the client ID.
protected  java.lang.String getDefaultLabelValign(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  java.lang.String getFieldCellContentsStyleClass(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  java.lang.String getFooterContentsStyleClass(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  java.lang.String getLabel(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected abstract  java.lang.String getLabelFor(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns the ID (clientId) of the component that should receive the label.
protected  java.lang.String getLabelInlineStyleKey(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  java.lang.String getLabelStyleClass(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          This gets the rootStyleClass from the bean, appends ::label to it,
 boolean getRendersChildren()
           
protected  boolean getRequired(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  java.lang.String getRootStyleClass(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  boolean getShowRequired(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  boolean hasMessage(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  boolean hasOwnLabel(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Override and return "true" to indicate that the component has its own internal label - and that therefore there shouldn't be an HTML <label> tag, for instance.
protected  boolean isContentEditable(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          If it's known that the field content is not editable, return false.
protected  boolean isIndented()
           
protected  boolean isLeafRenderer()
           
protected  boolean labelShowRequired(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Hook for resolving whether we should show the "required" icon.
protected  void renderEndFacetForNarrowPDA(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, boolean insideTableData)
           
protected abstract  void renderFieldCellContents(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  void renderFieldFooterContents(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Renders footer contents if isFooterPresent() is true.
protected  void renderRootDomElementStyles(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  boolean shouldRenderId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Returns true if the component should render an ID.
protected  boolean showAccessKeyOnLabel(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
 
Methods inherited from class org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer
canSkipRendering, canSkipRendering, cloneWithType, getAbsoluteImageUri, getBaseImageUri, getDefaultStyleClass, getInlineStyle, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getPartialTriggers, getShortDesc, getStyleClass, renderAllAttributes, renderAllAttributes, renderDecorativeIcon, renderDecorativeIcon, renderEventHandlers, renderFormattedText, renderHAlign, renderInlineStyle, renderInlineStyleAttribute, renderPossiblyFormattedText, renderScriptDeferAttribute, renderScriptTypeAttribute, renderShortDescAttribute, renderSpacer, renderStyleAttributes, renderStyleAttributes, renderSubmitButtonNonJSBrowser, renderTransparent, renderVerticalSpacer, resolveProperty, resolveProperty, skipDecode, supportsAccessKeys, supportsAdvancedForms, supportsAutoCompleteFormElements, supportsDisabledFormElements, supportsEditing, supportsIntrinsicEvents, supportsNarrowScreen, supportsNavigation, supportsOnClickOnImgInput, supportsReadonlyFormElements, supportsScripting, supportsSeparateWindow, supportsStyleAttributes, supportsTarget, supportsTextPresentation
 
Methods inherited from class org.apache.myfaces.trinidad.render.CoreRenderer
afterEncode, beforeEncode, decode, decode, decodeBehaviors, delegateRenderer, delegateRendererBegin, delegateRendererEnd, encodeAllChildren, encodeBegin, encodeBegin, encodeChild, encodeChildren, encodeComponentResources, encodeEnd, encodeEnd, getBehaviorParameters, getFacesBean, getFacet, getNextRenderedChildIndex, getRenderedChildCount, getRenderedFacetsAndChildren, getRenderingProperty, hasRenderedChildren, isDesktop, isGecko, isGenericPDA, isIE, isInaccessibleMode, isIPhone, isKonqueror, isNokiaS60, isOpera, isPDA, isScreenReaderMode, isWebKit, partialEncodeVisit, renderEncodedActionURI, renderEncodedResourceURI, renderId, renderStyleClass, renderStyleClasses, setRenderingProperty, setupChildrenEncodingContext, setupEncodingContext, setupEncodingContext, tearDownChildrenEncodingContext, tearDownEncodingContext, tearDownEncodingContext, toActionUri, toChar, toInt, toLong, toResourceUri, toString, toUri, visitChildrenForEncoding
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INLINE_MESSAGE_DEFAULT_GAP

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

INLINE_MESSAGE_PDA_GAP

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

LabelAndMessageRenderer

public LabelAndMessageRenderer(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
Method Detail

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.render.Renderer

findTypeConstants

protected void findTypeConstants(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
Overrides:
findTypeConstants in class XhtmlRenderer

renderRootDomElementStyles

protected void renderRootDomElementStyles(javax.faces.context.FacesContext context,
                                          org.apache.myfaces.trinidad.context.RenderingContext rc,
                                          javax.faces.component.UIComponent component,
                                          org.apache.myfaces.trinidad.bean.FacesBean bean)
                                   throws java.io.IOException
Throws:
java.io.IOException

shouldRenderId

protected boolean shouldRenderId(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component)
Description copied from class: XhtmlRenderer
Returns true if the component should render an ID. Components that deliver events should always return "true".

Overrides:
shouldRenderId in class XhtmlRenderer

encodeAll

protected void encodeAll(javax.faces.context.FacesContext context,
                         org.apache.myfaces.trinidad.context.RenderingContext rc,
                         javax.faces.component.UIComponent component,
                         org.apache.myfaces.trinidad.bean.FacesBean bean)
                  throws java.io.IOException
Overrides:
encodeAll in class org.apache.myfaces.trinidad.render.CoreRenderer
Throws:
java.io.IOException

getRootStyleClass

protected java.lang.String getRootStyleClass(javax.faces.component.UIComponent component,
                                             org.apache.myfaces.trinidad.bean.FacesBean bean)

getFieldCellContentsStyleClass

protected java.lang.String getFieldCellContentsStyleClass(javax.faces.component.UIComponent component,
                                                          org.apache.myfaces.trinidad.bean.FacesBean bean)

getFooterContentsStyleClass

protected java.lang.String getFooterContentsStyleClass(javax.faces.component.UIComponent component,
                                                       org.apache.myfaces.trinidad.bean.FacesBean bean)

hasMessage

protected boolean hasMessage(javax.faces.context.FacesContext context,
                             org.apache.myfaces.trinidad.context.RenderingContext rc,
                             javax.faces.component.UIComponent component,
                             org.apache.myfaces.trinidad.bean.FacesBean bean)

getClientId

protected java.lang.String getClientId(javax.faces.context.FacesContext context,
                                       javax.faces.component.UIComponent component)
Returns the client ID.

Overrides:
getClientId in class org.apache.myfaces.trinidad.render.CoreRenderer

isLeafRenderer

protected boolean isLeafRenderer()

getDefaultLabelValign

protected java.lang.String getDefaultLabelValign(javax.faces.component.UIComponent component,
                                                 org.apache.myfaces.trinidad.bean.FacesBean bean)

renderFieldCellContents

protected abstract void renderFieldCellContents(javax.faces.context.FacesContext context,
                                                org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                javax.faces.component.UIComponent component,
                                                org.apache.myfaces.trinidad.bean.FacesBean bean)
                                         throws java.io.IOException
Throws:
java.io.IOException

renderFieldFooterContents

protected void renderFieldFooterContents(javax.faces.context.FacesContext context,
                                         org.apache.myfaces.trinidad.context.RenderingContext rc,
                                         javax.faces.component.UIComponent component,
                                         org.apache.myfaces.trinidad.bean.FacesBean bean)
                                  throws java.io.IOException
Renders footer contents if isFooterPresent() is true.

Parameters:
context - the FacesContext
rc - the RenderingContext
component - the component to render
bean - the FacesBean of the component to render
Throws:
java.io.IOException - if there are problems rendering the contents

isContentEditable

protected boolean isContentEditable(javax.faces.component.UIComponent component,
                                    org.apache.myfaces.trinidad.bean.FacesBean bean)
If it's known that the field content is not editable, return false. Otherwise, assume it is editable and return true


isIndented

protected boolean isIndented()

hasOwnLabel

protected boolean hasOwnLabel(javax.faces.component.UIComponent component,
                              org.apache.myfaces.trinidad.bean.FacesBean bean)
Override and return "true" to indicate that the component has its own internal label - and that therefore there shouldn't be an HTML <label> tag, for instance.


showAccessKeyOnLabel

protected boolean showAccessKeyOnLabel(javax.faces.component.UIComponent component,
                                       org.apache.myfaces.trinidad.bean.FacesBean bean)

getLabelFor

protected abstract java.lang.String getLabelFor(javax.faces.context.FacesContext context,
                                                org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                javax.faces.component.UIComponent component,
                                                org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns the ID (clientId) of the component that should receive the label.


getLabelInlineStyleKey

protected java.lang.String getLabelInlineStyleKey(javax.faces.component.UIComponent component,
                                                  org.apache.myfaces.trinidad.bean.FacesBean bean)

labelShowRequired

protected boolean labelShowRequired(javax.faces.component.UIComponent component,
                                    org.apache.myfaces.trinidad.bean.FacesBean bean)
Hook for resolving whether we should show the "required" icon.


getShowRequired

protected boolean getShowRequired(javax.faces.component.UIComponent component,
                                  org.apache.myfaces.trinidad.bean.FacesBean bean)

getRequired

protected boolean getRequired(javax.faces.component.UIComponent component,
                              org.apache.myfaces.trinidad.bean.FacesBean bean)

getLabel

protected java.lang.String getLabel(javax.faces.component.UIComponent component,
                                    org.apache.myfaces.trinidad.bean.FacesBean bean)

getLabelStyleClass

protected java.lang.String getLabelStyleClass(javax.faces.component.UIComponent component,
                                              org.apache.myfaces.trinidad.bean.FacesBean bean)
This gets the rootStyleClass from the bean, appends ::label to it,

Parameters:
bean -
Returns:

renderEndFacetForNarrowPDA

protected void renderEndFacetForNarrowPDA(javax.faces.context.FacesContext context,
                                          org.apache.myfaces.trinidad.context.RenderingContext rc,
                                          javax.faces.component.UIComponent component,
                                          boolean insideTableData)
                                   throws java.io.IOException
Throws:
java.io.IOException


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