Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.myfaces.renderkit.html
Class HtmlRendererUtils  view HtmlRendererUtils download HtmlRendererUtils.java

java.lang.Object
  extended byorg.apache.myfaces.renderkit.html.HtmlRendererUtils

public final class HtmlRendererUtils
extends java.lang.Object

Version:
$Revision: 291881 $ $Date: 2005-09-27 05:59:11 -0400 (Tue, 27 Sep 2005) $

Nested Class Summary
static class HtmlRendererUtils.LinkParameter
           
 
Field Summary
private static java.lang.String ANY_CONTENT_TYPE
           
private static java.lang.String APPLICATION_XML_CONTENT_TYPE
           
static java.lang.String DEFAULT_CHAR_ENCODING
           
private static java.lang.String HIDDEN_COMMANDLINK_FIELD_NAME
           
private static java.lang.String HTML_CONTENT_TYPE
           
private static java.lang.String LINE_SEPARATOR
           
private static org.apache.commons.logging.Log log
           
private static java.lang.String TEXT_XML_CONTENT_TYPE
           
private static java.lang.String XHTML_CONTENT_TYPE
           
 
Constructor Summary
private HtmlRendererUtils()
           
 
Method Summary
static void decodeUIInput(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
          X-CHECKED: tlddoc h:inputText
static void decodeUISelectBoolean(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
          X-CHECKED: tlddoc h:selectBooleanCheckbox
static void decodeUISelectMany(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
          X-CHECKED: tlddoc h:selectManyListbox
static void decodeUISelectOne(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
          X-CHECKED: tlddoc h:selectManyListbox
static javax.faces.convert.Converter findUIOutputConverterFailSafe(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
           
static javax.faces.convert.Converter findUISelectManyConverterFailsafe(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
           
static java.lang.String getClearHiddenCommandFormParamsFunctionName(java.lang.String formName)
          Prefixes the given String with "clear_" and removes special characters
static java.lang.String getDisplayValueOnlyStyle(javax.faces.component.UIComponent component)
           
static java.lang.String getDisplayValueOnlyStyleClass(javax.faces.component.UIComponent component)
           
static java.lang.String getFormName(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context)
           
static java.lang.String getHiddenCommandLinkFieldName(java.lang.String formName)
           
static java.util.Set getSubmittedOrSelectedValuesAsSet(boolean selectMany, javax.faces.component.UIComponent uiComponent, javax.faces.context.FacesContext facesContext, javax.faces.convert.Converter converter)
           
static java.lang.String[] getSupportedContentTypes()
           
private static void internalRenderSelect(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, boolean disabled, int size, boolean selectMany)
           
static boolean isDisabledOrReadOnly(javax.faces.component.UIComponent component)
           
static boolean isDisplayValueOnly(javax.faces.component.UIComponent component)
           
private static boolean isHTMLContentType(java.lang.String contentType)
           
private static boolean isTrue(java.lang.Object obj)
           
static boolean isXHTMLContentType(java.lang.String contentType)
           
static void renderClearHiddenCommandFormParamsFunction(javax.faces.context.ResponseWriter writer, java.lang.String formName, java.util.Set dummyFormParams, java.lang.String formTarget)
          Render the javascript function that is called on a click on a commandLink to clear the hidden inputs.
static void renderDisplayValueOnly(javax.faces.context.FacesContext facesContext, javax.faces.component.UIInput input)
           
static void renderDisplayValueOnlyAttributes(javax.faces.component.UIComponent uiComponent, javax.faces.context.ResponseWriter writer)
           
static void renderDisplayValueOnlyForSelects(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
           
static void renderHiddenCommandFormParams(javax.faces.context.ResponseWriter writer, java.util.Set dummyFormParams)
           
static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer, java.lang.String componentProperty, java.lang.String attrName, java.lang.Object value)
           
static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String componentProperty, java.lang.String htmlAttrName)
           
static boolean renderHTMLAttributes(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String[] attributes)
           
static boolean renderHTMLAttributesWithOptionalStartElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String elementName, java.lang.String[] attributes)
           
static boolean renderHTMLAttributeWithOptionalStartElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String elementName, java.lang.String attrName, java.lang.Object value, boolean startElementWritten)
           
static void renderListbox(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectMany selectMany, boolean disabled, int size)
           
static void renderListbox(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectOne selectOne, boolean disabled, int size)
           
static void renderMenu(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectMany selectMany, boolean disabled)
           
static void renderMenu(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectOne selectOne, boolean disabled)
           
static boolean renderOptionalEndElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String elementName, java.lang.String[] attributes)
           
static void renderSelectOptions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.convert.Converter converter, java.util.Set lookupSet, java.util.List selectItemList)
          Renders the select options for a UIComponent that is rendered as an HTML select element.
private static void renderSelectOptionsAsText(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.convert.Converter converter, java.util.Set lookupSet, java.util.List selectItemList, boolean isSelectOne)
           
static java.lang.String selectContentType(java.lang.String contentTypeListString)
           
private static java.util.List splitContentTypeListString(java.lang.String contentTypeListString)
           
static void writeIdIfNecessary(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, javax.faces.context.FacesContext facesContext)
           
static void writePrettyIndent(javax.faces.context.FacesContext facesContext)
           
static void writePrettyLineSeparator(javax.faces.context.FacesContext facesContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

LINE_SEPARATOR

private static final java.lang.String LINE_SEPARATOR

HIDDEN_COMMANDLINK_FIELD_NAME

private static final java.lang.String HIDDEN_COMMANDLINK_FIELD_NAME
See Also:
Constant Field Values

HTML_CONTENT_TYPE

private static java.lang.String HTML_CONTENT_TYPE

ANY_CONTENT_TYPE

private static java.lang.String ANY_CONTENT_TYPE

DEFAULT_CHAR_ENCODING

public static java.lang.String DEFAULT_CHAR_ENCODING

XHTML_CONTENT_TYPE

private static java.lang.String XHTML_CONTENT_TYPE

APPLICATION_XML_CONTENT_TYPE

private static java.lang.String APPLICATION_XML_CONTENT_TYPE

TEXT_XML_CONTENT_TYPE

private static java.lang.String TEXT_XML_CONTENT_TYPE
Constructor Detail

HtmlRendererUtils

private HtmlRendererUtils()
Method Detail

decodeUIInput

public static void decodeUIInput(javax.faces.context.FacesContext facesContext,
                                 javax.faces.component.UIComponent component)
X-CHECKED: tlddoc h:inputText


decodeUISelectBoolean

public static void decodeUISelectBoolean(javax.faces.context.FacesContext facesContext,
                                         javax.faces.component.UIComponent component)
X-CHECKED: tlddoc h:selectBooleanCheckbox


isDisabledOrReadOnly

public static boolean isDisabledOrReadOnly(javax.faces.component.UIComponent component)

isTrue

private static boolean isTrue(java.lang.Object obj)

decodeUISelectMany

public static void decodeUISelectMany(javax.faces.context.FacesContext facesContext,
                                      javax.faces.component.UIComponent component)
X-CHECKED: tlddoc h:selectManyListbox


decodeUISelectOne

public static void decodeUISelectOne(javax.faces.context.FacesContext facesContext,
                                     javax.faces.component.UIComponent component)
X-CHECKED: tlddoc h:selectManyListbox


renderListbox

public static void renderListbox(javax.faces.context.FacesContext facesContext,
                                 javax.faces.component.UISelectOne selectOne,
                                 boolean disabled,
                                 int size)
                          throws java.io.IOException

renderListbox

public static void renderListbox(javax.faces.context.FacesContext facesContext,
                                 javax.faces.component.UISelectMany selectMany,
                                 boolean disabled,
                                 int size)
                          throws java.io.IOException

renderMenu

public static void renderMenu(javax.faces.context.FacesContext facesContext,
                              javax.faces.component.UISelectOne selectOne,
                              boolean disabled)
                       throws java.io.IOException

renderMenu

public static void renderMenu(javax.faces.context.FacesContext facesContext,
                              javax.faces.component.UISelectMany selectMany,
                              boolean disabled)
                       throws java.io.IOException

internalRenderSelect

private static void internalRenderSelect(javax.faces.context.FacesContext facesContext,
                                         javax.faces.component.UIComponent uiComponent,
                                         boolean disabled,
                                         int size,
                                         boolean selectMany)
                                  throws java.io.IOException

getSubmittedOrSelectedValuesAsSet

public static java.util.Set getSubmittedOrSelectedValuesAsSet(boolean selectMany,
                                                              javax.faces.component.UIComponent uiComponent,
                                                              javax.faces.context.FacesContext facesContext,
                                                              javax.faces.convert.Converter converter)

findUISelectManyConverterFailsafe

public static javax.faces.convert.Converter findUISelectManyConverterFailsafe(javax.faces.context.FacesContext facesContext,
                                                                              javax.faces.component.UIComponent uiComponent)

findUIOutputConverterFailSafe

public static javax.faces.convert.Converter findUIOutputConverterFailSafe(javax.faces.context.FacesContext facesContext,
                                                                          javax.faces.component.UIComponent uiComponent)

renderSelectOptions

public static void renderSelectOptions(javax.faces.context.FacesContext context,
                                       javax.faces.component.UIComponent component,
                                       javax.faces.convert.Converter converter,
                                       java.util.Set lookupSet,
                                       java.util.List selectItemList)
                                throws java.io.IOException
Renders the select options for a UIComponent that is rendered as an HTML select element.


writePrettyLineSeparator

public static void writePrettyLineSeparator(javax.faces.context.FacesContext facesContext)
                                     throws java.io.IOException

writePrettyIndent

public static void writePrettyIndent(javax.faces.context.FacesContext facesContext)
                              throws java.io.IOException

renderHTMLAttribute

public static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer,
                                          java.lang.String componentProperty,
                                          java.lang.String attrName,
                                          java.lang.Object value)
                                   throws java.io.IOException

renderHTMLAttribute

public static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer,
                                          javax.faces.component.UIComponent component,
                                          java.lang.String componentProperty,
                                          java.lang.String htmlAttrName)
                                   throws java.io.IOException

renderHTMLAttributes

public static boolean renderHTMLAttributes(javax.faces.context.ResponseWriter writer,
                                           javax.faces.component.UIComponent component,
                                           java.lang.String[] attributes)
                                    throws java.io.IOException

renderHTMLAttributeWithOptionalStartElement

public static boolean renderHTMLAttributeWithOptionalStartElement(javax.faces.context.ResponseWriter writer,
                                                                  javax.faces.component.UIComponent component,
                                                                  java.lang.String elementName,
                                                                  java.lang.String attrName,
                                                                  java.lang.Object value,
                                                                  boolean startElementWritten)
                                                           throws java.io.IOException

renderHTMLAttributesWithOptionalStartElement

public static boolean renderHTMLAttributesWithOptionalStartElement(javax.faces.context.ResponseWriter writer,
                                                                   javax.faces.component.UIComponent component,
                                                                   java.lang.String elementName,
                                                                   java.lang.String[] attributes)
                                                            throws java.io.IOException

renderOptionalEndElement

public static boolean renderOptionalEndElement(javax.faces.context.ResponseWriter writer,
                                               javax.faces.component.UIComponent component,
                                               java.lang.String elementName,
                                               java.lang.String[] attributes)
                                        throws java.io.IOException

writeIdIfNecessary

public static void writeIdIfNecessary(javax.faces.context.ResponseWriter writer,
                                      javax.faces.component.UIComponent component,
                                      javax.faces.context.FacesContext facesContext)
                               throws java.io.IOException

renderDisplayValueOnlyForSelects

public static void renderDisplayValueOnlyForSelects(javax.faces.context.FacesContext facesContext,
                                                    javax.faces.component.UIComponent uiComponent)
                                             throws java.io.IOException

renderDisplayValueOnlyAttributes

public static void renderDisplayValueOnlyAttributes(javax.faces.component.UIComponent uiComponent,
                                                    javax.faces.context.ResponseWriter writer)
                                             throws java.io.IOException

renderSelectOptionsAsText

private static void renderSelectOptionsAsText(javax.faces.context.FacesContext context,
                                              javax.faces.component.UIComponent component,
                                              javax.faces.convert.Converter converter,
                                              java.util.Set lookupSet,
                                              java.util.List selectItemList,
                                              boolean isSelectOne)
                                       throws java.io.IOException

getDisplayValueOnlyStyleClass

public static java.lang.String getDisplayValueOnlyStyleClass(javax.faces.component.UIComponent component)

getDisplayValueOnlyStyle

public static java.lang.String getDisplayValueOnlyStyle(javax.faces.component.UIComponent component)

isDisplayValueOnly

public static boolean isDisplayValueOnly(javax.faces.component.UIComponent component)

renderDisplayValueOnly

public static void renderDisplayValueOnly(javax.faces.context.FacesContext facesContext,
                                          javax.faces.component.UIInput input)
                                   throws java.io.IOException

renderHiddenCommandFormParams

public static void renderHiddenCommandFormParams(javax.faces.context.ResponseWriter writer,
                                                 java.util.Set dummyFormParams)
                                          throws java.io.IOException

renderClearHiddenCommandFormParamsFunction

public static void renderClearHiddenCommandFormParamsFunction(javax.faces.context.ResponseWriter writer,
                                                              java.lang.String formName,
                                                              java.util.Set dummyFormParams,
                                                              java.lang.String formTarget)
                                                       throws java.io.IOException
Render the javascript function that is called on a click on a commandLink to clear the hidden inputs. This is necessary because on a browser back, each hidden input still has it's old value (browser cache!) and therefore a new submit would cause the according action once more!


getClearHiddenCommandFormParamsFunctionName

public static java.lang.String getClearHiddenCommandFormParamsFunctionName(java.lang.String formName)
Prefixes the given String with "clear_" and removes special characters


getFormName

public static java.lang.String getFormName(javax.faces.component.UIComponent component,
                                           javax.faces.context.FacesContext context)

getHiddenCommandLinkFieldName

public static java.lang.String getHiddenCommandLinkFieldName(java.lang.String formName)

selectContentType

public static java.lang.String selectContentType(java.lang.String contentTypeListString)

getSupportedContentTypes

public static java.lang.String[] getSupportedContentTypes()

isHTMLContentType

private static boolean isHTMLContentType(java.lang.String contentType)

isXHTMLContentType

public static boolean isXHTMLContentType(java.lang.String contentType)

splitContentTypeListString

private static java.util.List splitContentTypeListString(java.lang.String contentTypeListString)