org.apache.myfaces.tobago.component
Class ComponentUtil

java.lang.Object
  extended by org.apache.myfaces.tobago.component.ComponentUtil

public class ComponentUtil
extends java.lang.Object


Field Summary
static java.lang.Class[] ACTION_ARGS
           
static java.lang.Class[] ACTION_LISTENER_ARGS
           
static java.lang.Class[] VALIDATOR_ARGS
           
static java.lang.Class[] VALUE_CHANGE_LISTENER_ARGS
           
 
Method Summary
static void addOnloadCommands(UIComponent component, java.lang.String[] cmds)
           
static void addScripts(UIComponent component, java.lang.String[] scripts)
           
static void addStyles(UIComponent component, java.lang.String[] styles)
           
static boolean containsPopupActionListener(UICommand command)
           
static ActionListener createActionListener(java.lang.String type)
           
static UIColumn createColumn(java.lang.String label, java.lang.String sortable, java.lang.String align, UIComponent child)
          Deprecated.  
static UIColumn createColumn(java.lang.String label, java.lang.String sortable, java.lang.String align, UIComponent child, java.lang.String id)
           
static UIComponent createComponent(FacesContext facesContext, java.lang.String componentType, java.lang.String rendererType)
          Deprecated.  
static UIComponent createComponent(FacesContext facesContext, java.lang.String componentType, java.lang.String rendererType, java.lang.String id)
           
static UIComponent createComponent(java.lang.String componentType, java.lang.String rendererType)
          Deprecated.  
static UIComponent createComponent(java.lang.String componentType, java.lang.String rendererType, java.lang.String id)
           
static java.lang.String createPickerId(FacesContext facesContext, UIComponent component, java.lang.String postfix)
           
static UIColumn createTextColumn(java.lang.String label, java.lang.String sortable, java.lang.String align, java.lang.String value)
          Deprecated.  
static UIColumn createTextColumn(java.lang.String label, java.lang.String sortable, java.lang.String align, java.lang.String value, java.lang.String id)
           
static UIMenuSelectOne createUIMenuSelectOneFacet(FacesContext facesContext, UICommand command)
          Deprecated.  
static UIMenuSelectOne createUIMenuSelectOneFacet(FacesContext facesContext, UICommand command, java.lang.String id)
           
static UIComponent createUISelectBooleanFacet(FacesContext facesContext, UICommand command)
          Deprecated.  
static UIComponent createUISelectBooleanFacet(FacesContext facesContext, UICommand command, java.lang.String id)
           
static ValueBinding createValueBinding(java.lang.String value)
           
static java.lang.String currentValue(UIComponent component)
           
static java.lang.String findClientIdFor(UIComponent component, FacesContext facesContext)
          Looks for the attribute "for" in the component.
static UIComponent findComponent(UIComponent from, java.lang.String relativeId)
          colonCount == 0: fully relative colonCount == 1: absolute (still normal findComponent syntax) colonCount > 1: for each extra colon after 1, go up a naming container (to the view root, if naming containers run out)
static
<T extends UIComponent>
T
findDescendant(UIComponent component, java.lang.Class<T> type)
          Searches the component tree beneath the component and return the first component matching the type.
static UIComponent findFor(UIComponent component)
           
static UIForm findForm(UIComponent component)
           
static UIPage findPage(FacesContext facesContext)
           
static UIPage findPage(FacesContext context, UIComponent component)
           
static UIPage findPage(UIComponent component)
           
static java.lang.Object findParameter(UIComponent component, java.lang.String name)
           
static java.util.List<UIForm> findSubForms(UIComponent component)
          Find all subforms of a component, and collects it.
static java.lang.Object getAttribute(UIComponent component, java.lang.String name)
           
static boolean getBooleanAttribute(UIComponent component, java.lang.String name)
           
static java.lang.Character getCharacterAttribute(UIComponent component, java.lang.String name)
           
static java.lang.Character getCharakterAttribute(UIComponent component, java.lang.String name)
          Deprecated. please use the method getCharacterAttribute(javax.faces.component.UIComponent, String)
static java.lang.String getComponentId(FacesContext facesContext, UIComponent component)
           
static java.lang.Object getConvertedValue(FacesContext facesContext, UIInput component, java.lang.String stringValue)
           
static java.lang.String getFacesMessageAsString(FacesContext facesContext, UIComponent component)
           
static UIGraphic getFirstGraphicChild(UIComponent component)
           
static UIOutput getFirstNonGraphicChild(UIComponent component)
           
static int getIntAttribute(UIComponent component, java.lang.String name)
           
static int getIntAttribute(UIComponent component, java.lang.String name, int defaultValue)
           
static int getIntValue(ValueBinding valueBinding)
           
static java.util.List<SelectItem> getItemsToRender(UISelectMany component)
           
static java.util.List<SelectItem> getItemsToRender(UISelectOne component)
           
static java.lang.String[] getMarkupBinding(FacesContext facesContext, SupportsMarkup component)
           
static FacesMessage.Severity getMaximumSeverity(UIComponent component)
           
static LayoutableRendererBase getRenderer(FacesContext facesContext, java.lang.String family, java.lang.String rendererType)
           
static LayoutableRendererBase getRenderer(FacesContext facesContext, UIComponent component)
           
static java.util.List<SelectItem> getSelectItems(UIComponent component)
           
static java.lang.String getStringAttribute(UIComponent component, java.lang.String name)
           
static java.lang.String getValueFromEl(java.lang.String script)
           
static boolean hasErrorMessages(FacesContext context)
           
static boolean hasSelectedValue(java.util.List<SelectItem> items, java.lang.Object value)
           
static void invokeOnComponent(FacesContext facesContext, java.lang.String clientId, UIComponent component, Callback callback)
           
static boolean isError(UIComponent component)
           
static boolean isError(UIInput uiInput)
           
static boolean isFacetOf(UIComponent component, UIComponent parent)
           
static boolean isHoverEnabled(UIComponent component)
           
static boolean isInActiveForm(UIComponent component)
           
static boolean isInPopup(UIComponent component)
           
static boolean isOutputOnly(UIComponent component)
           
static boolean mayUpdateModel(UIComponent component)
           
static boolean mayValidate(UIComponent component)
           
static UIComponent provideLabel(FacesContext facesContext, UIComponent component)
           
static java.lang.String removePx(java.lang.String value)
           
static void resetPage(FacesContext context)
           
static void setAction(UICommand component, java.lang.String type, java.lang.String action)
           
static void setAction(UIComponent component, java.lang.String type, java.lang.String action)
          Deprecated. please use the typesave method setAction(javax.faces.component.UICommand, String, String)
static void setActionListener(ActionSource command, java.lang.String actionListener)
           
static void setBooleanProperty(UIComponent component, java.lang.String name, java.lang.String value)
           
static void setConverter(UIComponent component, java.lang.String converterId)
          Deprecated. please use the typesave method setConverter(javax.faces.component.ValueHolder, String)
static void setConverter(ValueHolder valueHolder, java.lang.String converterId)
           
static void setIntegerProperty(UIComponent component, java.lang.String name, java.lang.String value)
           
static void setIntegerSizeProperty(UIComponent component, java.lang.String name, java.lang.String value)
           
static void setMarkup(UIComponent markupComponent, java.lang.String markup)
           
static void setRenderedPartially(UICommand command, java.lang.String renderers)
           
static void setSortActionListener(UIData data, java.lang.String actionListener)
           
static void setStateChangeListener(UIData data, java.lang.String stateChangeListener)
           
static void setStringProperty(UIComponent component, java.lang.String name, java.lang.String value)
           
static void setStyleClasses(UIComponent component, java.lang.String styleClasses)
           
static void setSuggestMethodBinding(UIComponent component, java.lang.String suggestMethod)
          Deprecated. please use the typesave method setSuggestMethodBinding(UIInput, String)
static void setSuggestMethodBinding(UIInput component, java.lang.String suggestMethod)
           
static void setValidator(EditableValueHolder editableValueHolder, java.lang.String validator)
           
static void setValueBinding(UIComponent component, java.lang.String name, java.lang.String state)
           
static void setValueChangeListener(EditableValueHolder valueHolder, java.lang.String valueChangeListener)
           
static void setValueForValueBinding(java.lang.String name, java.lang.Object value)
           
static java.lang.String toString(UIComponent component, int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_ARGS

public static final java.lang.Class[] ACTION_ARGS

ACTION_LISTENER_ARGS

public static final java.lang.Class[] ACTION_LISTENER_ARGS

VALUE_CHANGE_LISTENER_ARGS

public static final java.lang.Class[] VALUE_CHANGE_LISTENER_ARGS

VALIDATOR_ARGS

public static final java.lang.Class[] VALIDATOR_ARGS
Method Detail

hasErrorMessages

public static boolean hasErrorMessages(FacesContext context)

containsPopupActionListener

public static boolean containsPopupActionListener(UICommand command)

getFacesMessageAsString

public static java.lang.String getFacesMessageAsString(FacesContext facesContext,
                                                       UIComponent component)

isInPopup

public static boolean isInPopup(UIComponent component)

resetPage

public static void resetPage(FacesContext context)

findPage

public static UIPage findPage(FacesContext context,
                              UIComponent component)

findPage

public static UIPage findPage(UIComponent component)

addStyles

public static void addStyles(UIComponent component,
                             java.lang.String[] styles)

addScripts

public static void addScripts(UIComponent component,
                              java.lang.String[] scripts)

addOnloadCommands

public static void addOnloadCommands(UIComponent component,
                                     java.lang.String[] cmds)

findPage

public static UIPage findPage(FacesContext facesContext)

findForm

public static UIForm findForm(UIComponent component)

findSubForms

public static java.util.List<UIForm> findSubForms(UIComponent component)
Find all subforms of a component, and collects it. It does not find subforms of subforms.


findDescendant

public static <T extends UIComponent> T findDescendant(UIComponent component,
                                                       java.lang.Class<T> type)
Searches the component tree beneath the component and return the first component matching the type.


findClientIdFor

public static java.lang.String findClientIdFor(UIComponent component,
                                               FacesContext facesContext)
Looks for the attribute "for" in the component. If there is any search for the component which is referenced by the "for" attribute, and return their clientId. If there is no "for" attribute, return the "clientId" of the parent (if it has a parent). This is useful for labels.


findFor

public static UIComponent findFor(UIComponent component)

isInActiveForm

public static boolean isInActiveForm(UIComponent component)

getMaximumSeverity

public static FacesMessage.Severity getMaximumSeverity(UIComponent component)

isError

public static boolean isError(UIInput uiInput)

isError

public static boolean isError(UIComponent component)

isOutputOnly

public static boolean isOutputOnly(UIComponent component)

mayValidate

public static boolean mayValidate(UIComponent component)

mayUpdateModel

public static boolean mayUpdateModel(UIComponent component)

getBooleanAttribute

public static boolean getBooleanAttribute(UIComponent component,
                                          java.lang.String name)

setRenderedPartially

public static void setRenderedPartially(UICommand command,
                                        java.lang.String renderers)

setStyleClasses

public static void setStyleClasses(UIComponent component,
                                   java.lang.String styleClasses)

setMarkup

public static void setMarkup(UIComponent markupComponent,
                             java.lang.String markup)

getAttribute

public static java.lang.Object getAttribute(UIComponent component,
                                            java.lang.String name)

getStringAttribute

public static java.lang.String getStringAttribute(UIComponent component,
                                                  java.lang.String name)

getIntAttribute

public static int getIntAttribute(UIComponent component,
                                  java.lang.String name)

getIntAttribute

public static int getIntAttribute(UIComponent component,
                                  java.lang.String name,
                                  int defaultValue)

getCharakterAttribute

@Deprecated
public static java.lang.Character getCharakterAttribute(UIComponent component,
                                                                   java.lang.String name)
Deprecated. please use the method getCharacterAttribute(javax.faces.component.UIComponent, String)

Parameters:
component -
name -

getCharacterAttribute

public static java.lang.Character getCharacterAttribute(UIComponent component,
                                                        java.lang.String name)

isFacetOf

public static boolean isFacetOf(UIComponent component,
                                UIComponent parent)

getRenderer

public static LayoutableRendererBase getRenderer(FacesContext facesContext,
                                                 UIComponent component)

getRenderer

public static LayoutableRendererBase getRenderer(FacesContext facesContext,
                                                 java.lang.String family,
                                                 java.lang.String rendererType)

currentValue

public static java.lang.String currentValue(UIComponent component)

getSelectItems

public static java.util.List<SelectItem> getSelectItems(UIComponent component)

findParameter

public static java.lang.Object findParameter(UIComponent component,
                                             java.lang.String name)

toString

public static java.lang.String toString(UIComponent component,
                                        int offset)

createActionListener

public static ActionListener createActionListener(java.lang.String type)
                                           throws JspException
Throws:
JspException

getFirstGraphicChild

public static UIGraphic getFirstGraphicChild(UIComponent component)

isHoverEnabled

public static boolean isHoverEnabled(UIComponent component)

getFirstNonGraphicChild

public static UIOutput getFirstNonGraphicChild(UIComponent component)

setIntegerSizeProperty

public static void setIntegerSizeProperty(UIComponent component,
                                          java.lang.String name,
                                          java.lang.String value)

removePx

public static java.lang.String removePx(java.lang.String value)

setIntegerProperty

public static void setIntegerProperty(UIComponent component,
                                      java.lang.String name,
                                      java.lang.String value)

setBooleanProperty

public static void setBooleanProperty(UIComponent component,
                                      java.lang.String name,
                                      java.lang.String value)

setStringProperty

public static void setStringProperty(UIComponent component,
                                     java.lang.String name,
                                     java.lang.String value)

setValueForValueBinding

public static void setValueForValueBinding(java.lang.String name,
                                           java.lang.Object value)

createValueBinding

public static ValueBinding createValueBinding(java.lang.String value)

getValueFromEl

public static java.lang.String getValueFromEl(java.lang.String script)

createComponent

@Deprecated
public static UIComponent createComponent(java.lang.String componentType,
                                                     java.lang.String rendererType)
Deprecated. 

Please use createComponent(String componentType, String rendererType, String id)


createComponent

public static UIComponent createComponent(java.lang.String componentType,
                                          java.lang.String rendererType,
                                          java.lang.String id)

createComponent

@Deprecated
public static UIComponent createComponent(FacesContext facesContext,
                                                     java.lang.String componentType,
                                                     java.lang.String rendererType)
Deprecated. 

Please use createComponent(FacesContext facesContext, String componentType, String rendererType, String id)


createComponent

public static UIComponent createComponent(FacesContext facesContext,
                                          java.lang.String componentType,
                                          java.lang.String rendererType,
                                          java.lang.String id)

createTextColumn

@Deprecated
public static UIColumn createTextColumn(java.lang.String label,
                                                   java.lang.String sortable,
                                                   java.lang.String align,
                                                   java.lang.String value)
Deprecated. 

Please use createTextColumn(String label, String sortable, String align, String value, String id)


createTextColumn

public static UIColumn createTextColumn(java.lang.String label,
                                        java.lang.String sortable,
                                        java.lang.String align,
                                        java.lang.String value,
                                        java.lang.String id)

createColumn

@Deprecated
public static UIColumn createColumn(java.lang.String label,
                                               java.lang.String sortable,
                                               java.lang.String align,
                                               UIComponent child)
Deprecated. 

Please use createColumn(String label, String sortable, String align, UIComponent child)


createColumn

public static UIColumn createColumn(java.lang.String label,
                                    java.lang.String sortable,
                                    java.lang.String align,
                                    UIComponent child,
                                    java.lang.String id)

createUIMenuSelectOneFacet

@Deprecated
public static UIMenuSelectOne createUIMenuSelectOneFacet(FacesContext facesContext,
                                                                    UICommand command)
Deprecated. 

Please use createUIMenuSelectOneFacet(FacesContext facesContext, UICommand command, String id)


createUIMenuSelectOneFacet

public static UIMenuSelectOne createUIMenuSelectOneFacet(FacesContext facesContext,
                                                         UICommand command,
                                                         java.lang.String id)

hasSelectedValue

public static boolean hasSelectedValue(java.util.List<SelectItem> items,
                                       java.lang.Object value)

createUISelectBooleanFacet

@Deprecated
public static UIComponent createUISelectBooleanFacet(FacesContext facesContext,
                                                                UICommand command)
Deprecated. 

Please use createUISelectBooleanFacet(FacesContext facesContext, UICommand command, String id)


createUISelectBooleanFacet

public static UIComponent createUISelectBooleanFacet(FacesContext facesContext,
                                                     UICommand command,
                                                     java.lang.String id)

getIntValue

public static int getIntValue(ValueBinding valueBinding)

createPickerId

public static java.lang.String createPickerId(FacesContext facesContext,
                                              UIComponent component,
                                              java.lang.String postfix)

getComponentId

public static java.lang.String getComponentId(FacesContext facesContext,
                                              UIComponent component)

provideLabel

public static UIComponent provideLabel(FacesContext facesContext,
                                       UIComponent component)

getItemsToRender

public static java.util.List<SelectItem> getItemsToRender(UISelectOne component)

getItemsToRender

public static java.util.List<SelectItem> getItemsToRender(UISelectMany component)

setValidator

public static void setValidator(EditableValueHolder editableValueHolder,
                                java.lang.String validator)

setConverter

@Deprecated
public static void setConverter(UIComponent component,
                                           java.lang.String converterId)
Deprecated. please use the typesave method setConverter(javax.faces.component.ValueHolder, String)

Parameters:
component -
converterId -

setConverter

public static void setConverter(ValueHolder valueHolder,
                                java.lang.String converterId)

setAction

@Deprecated
public static void setAction(UIComponent component,
                                        java.lang.String type,
                                        java.lang.String action)
Deprecated. please use the typesave method setAction(javax.faces.component.UICommand, String, String)

Parameters:
component -
type -
action -

setAction

public static void setAction(UICommand component,
                             java.lang.String type,
                             java.lang.String action)

setSuggestMethodBinding

@Deprecated
public static void setSuggestMethodBinding(UIComponent component,
                                                      java.lang.String suggestMethod)
Deprecated. please use the typesave method setSuggestMethodBinding(UIInput, String)

Parameters:
component -
suggestMethod -

setSuggestMethodBinding

public static void setSuggestMethodBinding(UIInput component,
                                           java.lang.String suggestMethod)

setActionListener

public static void setActionListener(ActionSource command,
                                     java.lang.String actionListener)

setValueChangeListener

public static void setValueChangeListener(EditableValueHolder valueHolder,
                                          java.lang.String valueChangeListener)

setSortActionListener

public static void setSortActionListener(UIData data,
                                         java.lang.String actionListener)

setValueBinding

public static void setValueBinding(UIComponent component,
                                   java.lang.String name,
                                   java.lang.String state)

setStateChangeListener

public static void setStateChangeListener(UIData data,
                                          java.lang.String stateChangeListener)

getMarkupBinding

public static java.lang.String[] getMarkupBinding(FacesContext facesContext,
                                                  SupportsMarkup component)

findComponent

public static UIComponent findComponent(UIComponent from,
                                        java.lang.String relativeId)
colonCount == 0: fully relative colonCount == 1: absolute (still normal findComponent syntax) colonCount > 1: for each extra colon after 1, go up a naming container (to the view root, if naming containers run out)


invokeOnComponent

public static void invokeOnComponent(FacesContext facesContext,
                                     java.lang.String clientId,
                                     UIComponent component,
                                     Callback callback)

getConvertedValue

public static java.lang.Object getConvertedValue(FacesContext facesContext,
                                                 UIInput component,
                                                 java.lang.String stringValue)


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.