public final class ComponentUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Class[] |
ACTION_ARGS |
static Class[] |
ACTION_LISTENER_ARGS |
static String |
DATA_ATTRIBUTES_KEY
Name of the map for data attributes in components.
|
static String |
LIST_SEPARATOR_CHARS |
static String |
SUB_SEPARATOR |
static Class[] |
VALIDATOR_ARGS |
static Class[] |
VALUE_CHANGE_LISTENER_ARGS |
Modifier and Type | Method and Description |
---|---|
static void |
addCurrentMarkup(SupportsMarkup component,
Markup markup) |
static boolean |
containsPopupActionListener(javax.faces.component.UICommand command) |
static javax.faces.event.ActionListener |
createActionListener(String type)
Deprecated.
since 2.0.0
|
static String |
createPickerId(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
String postfix)
Deprecated.
since 2.0.0
|
static javax.faces.el.ValueBinding |
createValueBinding(String value)
Deprecated.
since 2.0.0
|
static void |
evaluateAutoFor(javax.faces.component.UIComponent component)
Deprecated.
|
static void |
evaluateAutoFor(javax.faces.component.UIComponent component,
Class<? extends javax.faces.component.UIComponent> clazz)
Looks for the attribute "for" of the component.
|
static String |
evaluateClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String componentId)
Resolves the real clientId.
|
static String[] |
evaluateClientIds(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String[] componentIds)
Resolves the real clientIds.
|
static <T> T |
findAncestor(javax.faces.component.UIComponent component,
Class<T> type) |
static <T extends javax.faces.component.UIComponent> |
findChild(javax.faces.component.UIComponent component,
Class<T> type)
Searches the children beneath the component and return the first component matching the type.
|
static String |
findClientIdFor(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext facesContext)
Looks for the attribute "for" in the component.
|
static javax.faces.component.UIComponent |
findComponent(javax.faces.component.UIComponent from,
String relativeId)
The search depends on the number of prefixed colons in the relativeId:
number of prefixed colons == 0
fully relative
number of prefixed colons == 1
absolute (still normal findComponent syntax)
number of prefixed colons == 2
search in the current naming container (same as 0 colons)
number of prefixed colons == 3
search in the parent naming container of the current naming container
number of prefixed colons > 3
go to the next parent naming container for each additional colon
If a literal is specified: to use more than one identifier the identifiers must be space delimited.
|
static <T extends javax.faces.component.UIComponent> |
findDescendant(javax.faces.component.UIComponent component,
Class<T> type)
Searches the component tree beneath the component and return the first component matching the type.
|
static <T extends javax.faces.component.UIComponent> |
findDescendantList(javax.faces.component.UIComponent component,
Class<T> type)
Searches the component tree beneath the component and return all component matching the type.
|
static <T extends javax.faces.component.UIComponent> |
findFacetDescendant(javax.faces.component.UIComponent component,
String facet,
Class<T> type)
Searches the component tree beneath the component and return the first component matching the type.
|
static javax.faces.component.UIComponent |
findFor(javax.faces.component.UIComponent component) |
static AbstractUIForm |
findForm(javax.faces.component.UIComponent component) |
static AbstractUIPage |
findPage(javax.faces.context.FacesContext facesContext) |
static AbstractUIPage |
findPage(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
static AbstractUIPage |
findPage(javax.faces.component.UIComponent component) |
static Object |
findParameter(javax.faces.component.UIComponent component,
String name) |
static List<AbstractUIForm> |
findSubForms(javax.faces.component.UIComponent component)
Find all sub forms of a component, and collects it.
|
static javax.faces.component.UIViewRoot |
findViewRoot(javax.faces.view.facelets.FaceletContext faceletContext,
javax.faces.component.UIComponent component)
Tries to walk up the parents to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for
the view root.
|
static Object |
getAttribute(javax.faces.component.UIComponent component,
String name) |
static boolean |
getBooleanAttribute(javax.faces.component.UIComponent component,
String name) |
static Character |
getCharacterAttribute(javax.faces.component.UIComponent component,
String name) |
static String[] |
getChildrenWithMessages(javax.faces.context.FacesContext facesContext,
javax.faces.component.NamingContainer container)
Deprecated.
since 2.0.0
|
static String |
getComponentId(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Deprecated.
since 2.0.0
|
static Object |
getConvertedValue(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
String stringValue) |
static Object |
getDataAttribute(javax.faces.component.UIComponent component,
String name) |
static Map<Object,Object> |
getDataAttributes(javax.faces.component.UIComponent component) |
static String |
getFacesMessageAsString(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component) |
static javax.faces.component.UIGraphic |
getFirstGraphicChild(javax.faces.component.UIComponent component)
Deprecated.
since 2.0.0
|
static javax.faces.component.UIOutput |
getFirstNonGraphicChild(javax.faces.component.UIComponent component)
Deprecated.
since 2.0.0
|
static int |
getIntAttribute(javax.faces.component.UIComponent component,
String name) |
static int |
getIntAttribute(javax.faces.component.UIComponent component,
String name,
int defaultValue) |
static int |
getIntValue(javax.faces.el.ValueBinding valueBinding)
Deprecated.
since 2.0.0
|
static String[] |
getMarkupBinding(javax.faces.context.FacesContext facesContext,
SupportsMarkup component)
Deprecated.
since 1.5
|
static javax.faces.application.FacesMessage.Severity |
getMaximumSeverity(javax.faces.component.UIComponent component) |
static javax.faces.application.FacesMessage.Severity |
getMaximumSeverityOfChildrenMessages(javax.faces.context.FacesContext facesContext,
javax.faces.component.NamingContainer container) |
static Object |
getObjectAttribute(javax.faces.component.UIComponent component,
String name) |
static RendererBase |
getRenderer(javax.faces.context.FacesContext facesContext,
String family,
String rendererType) |
static RendererBase |
getRenderer(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component) |
static String |
getStringAttribute(javax.faces.component.UIComponent component,
String name) |
static boolean |
hasChildrenWithMessages(javax.faces.context.FacesContext facesContext,
javax.faces.component.NamingContainer container)
Deprecated.
since 2.0.0
|
static boolean |
hasErrorMessages(javax.faces.context.FacesContext context) |
static boolean |
hasSelectedValue(List<javax.faces.model.SelectItem> items,
Object value)
Deprecated.
Since Tobago 2.0
|
static boolean |
invokeOnComponent(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String clientId,
javax.faces.component.ContextCallback callback)
Deprecated.
since 2.0.0, please use
UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String,
javax.faces.component.ContextCallback) |
static boolean |
isError(javax.faces.component.UIComponent component) |
static boolean |
isError(javax.faces.component.UIInput uiInput) |
static boolean |
isFacetOf(javax.faces.component.UIComponent component,
javax.faces.component.UIComponent parent) |
static boolean |
isHoverEnabled(javax.faces.component.UIComponent component)
Deprecated.
since 2.0.0
|
static boolean |
isInActiveForm(javax.faces.component.UIComponent component) |
static boolean |
isInPopup(javax.faces.component.UIComponent component) |
static boolean |
isOutputOnly(javax.faces.component.UIComponent component) |
static Markup |
markupOfSeverity(javax.faces.application.FacesMessage.Severity maximumSeverity) |
static boolean |
mayUpdateModel(javax.faces.component.UIComponent component) |
static boolean |
mayValidate(javax.faces.component.UIComponent component) |
static javax.faces.component.UIComponent |
provideLabel(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Deprecated.
since 2.0.0
|
static void |
putDataAttribute(javax.faces.component.UIComponent component,
Object name,
Object value)
Adding a data attribute to the component.
|
static void |
putDataAttributeWithPrefix(javax.faces.component.UIComponent component,
String name,
Object value)
Adding a data attribute to the component.
|
static String |
removePx(String value)
Deprecated.
since 2.0.0
|
static void |
resetPage(javax.faces.context.FacesContext context) |
static void |
setAction(javax.faces.component.ActionSource component,
String action)
Deprecated.
since 1.5.0
|
static void |
setActionListener(javax.faces.component.ActionSource command,
String actionListener)
Deprecated.
since 1.5.0
|
static void |
setConverter(javax.faces.component.ValueHolder valueHolder,
String converterId)
Deprecated.
since 1.5.0
|
static void |
setIntegerSizeProperty(javax.faces.component.UIComponent component,
String name,
String value)
Deprecated.
since 1.5.0
|
static void |
setMarkup(javax.faces.component.UIComponent markupComponent,
String markup)
Deprecated.
since 1.5.0
|
static void |
setStyleClasses(javax.faces.component.UIComponent component,
String styleClasses)
Deprecated.
since 1.5.0
Please define a
Markup and set it to the component with
SupportsMarkup.setMarkup(Markup markup) before the rendering phase. |
static void |
setValidator(javax.faces.component.EditableValueHolder editableValueHolder,
String validator)
Deprecated.
since 1.5.0
|
static void |
setValueBinding(javax.faces.component.UIComponent component,
String name,
String state)
Deprecated.
since 1.5.0
|
static void |
setValueChangeListener(javax.faces.component.EditableValueHolder valueHolder,
String valueChangeListener)
Deprecated.
since 1.5.0
|
static void |
setValueForValueBinding(String name,
Object value)
Deprecated.
since 2.0.0
|
static String[] |
splitList(String renderers) |
static Markup |
updateMarkup(javax.faces.component.UIComponent component,
Markup markup) |
public static final String SUB_SEPARATOR
public static final Class[] ACTION_ARGS
public static final Class[] ACTION_LISTENER_ARGS
public static final Class[] VALUE_CHANGE_LISTENER_ARGS
public static final Class[] VALIDATOR_ARGS
public static final String LIST_SEPARATOR_CHARS
public static final String DATA_ATTRIBUTES_KEY
public static boolean hasErrorMessages(javax.faces.context.FacesContext context)
public static boolean containsPopupActionListener(javax.faces.component.UICommand command)
public static String getFacesMessageAsString(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
public static boolean isInPopup(javax.faces.component.UIComponent component)
public static void resetPage(javax.faces.context.FacesContext context)
public static javax.faces.component.UIViewRoot findViewRoot(javax.faces.view.facelets.FaceletContext faceletContext, javax.faces.component.UIComponent component)
public static AbstractUIPage findPage(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
public static AbstractUIPage findPage(javax.faces.component.UIComponent component)
public static AbstractUIPage findPage(javax.faces.context.FacesContext facesContext)
public static AbstractUIForm findForm(javax.faces.component.UIComponent component)
public static <T> T findAncestor(javax.faces.component.UIComponent component, Class<T> type)
public static List<AbstractUIForm> findSubForms(javax.faces.component.UIComponent component)
public static <T extends javax.faces.component.UIComponent> T findDescendant(javax.faces.component.UIComponent component, Class<T> type)
public static <T extends javax.faces.component.UIComponent> T findFacetDescendant(javax.faces.component.UIComponent component, String facet, Class<T> type)
public static <T extends javax.faces.component.UIComponent> T findChild(javax.faces.component.UIComponent component, Class<T> type)
public static <T extends javax.faces.component.UIComponent> List<T> findDescendantList(javax.faces.component.UIComponent component, Class<T> type)
public static String findClientIdFor(javax.faces.component.UIComponent component, javax.faces.context.FacesContext facesContext)
public static javax.faces.component.UIComponent findFor(javax.faces.component.UIComponent component)
@Deprecated public static void evaluateAutoFor(javax.faces.component.UIComponent component)
public static void evaluateAutoFor(javax.faces.component.UIComponent component, Class<? extends javax.faces.component.UIComponent> clazz)
public static boolean isInActiveForm(javax.faces.component.UIComponent component)
public static javax.faces.application.FacesMessage.Severity getMaximumSeverity(javax.faces.component.UIComponent component)
public static boolean isError(javax.faces.component.UIInput uiInput)
public static boolean isError(javax.faces.component.UIComponent component)
public static boolean isOutputOnly(javax.faces.component.UIComponent component)
public static boolean mayValidate(javax.faces.component.UIComponent component)
public static boolean mayUpdateModel(javax.faces.component.UIComponent component)
public static boolean getBooleanAttribute(javax.faces.component.UIComponent component, String name)
@Deprecated public static javax.faces.el.ValueBinding createValueBinding(String value)
@Deprecated public static void setStyleClasses(javax.faces.component.UIComponent component, String styleClasses)
Markup
and set it to the component with
SupportsMarkup.setMarkup(Markup markup)
before the rendering phase.@Deprecated public static void setMarkup(javax.faces.component.UIComponent markupComponent, String markup)
public static Object getAttribute(javax.faces.component.UIComponent component, String name)
public static Object getObjectAttribute(javax.faces.component.UIComponent component, String name)
public static String getStringAttribute(javax.faces.component.UIComponent component, String name)
public static int getIntAttribute(javax.faces.component.UIComponent component, String name)
public static int getIntAttribute(javax.faces.component.UIComponent component, String name, int defaultValue)
public static Character getCharacterAttribute(javax.faces.component.UIComponent component, String name)
public static boolean isFacetOf(javax.faces.component.UIComponent component, javax.faces.component.UIComponent parent)
public static RendererBase getRenderer(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
public static RendererBase getRenderer(javax.faces.context.FacesContext facesContext, String family, String rendererType)
public static Object findParameter(javax.faces.component.UIComponent component, String name)
@Deprecated public static javax.faces.event.ActionListener createActionListener(String type) throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
@Deprecated public static javax.faces.component.UIGraphic getFirstGraphicChild(javax.faces.component.UIComponent component)
@Deprecated public static boolean isHoverEnabled(javax.faces.component.UIComponent component)
@Deprecated public static javax.faces.component.UIOutput getFirstNonGraphicChild(javax.faces.component.UIComponent component)
@Deprecated public static void setIntegerSizeProperty(javax.faces.component.UIComponent component, String name, String value)
@Deprecated public static String removePx(String value)
@Deprecated public static void setValueForValueBinding(String name, Object value)
@Deprecated public static boolean hasSelectedValue(List<javax.faces.model.SelectItem> items, Object value)
@Deprecated public static int getIntValue(javax.faces.el.ValueBinding valueBinding)
@Deprecated public static String createPickerId(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, String postfix)
@Deprecated public static String getComponentId(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
@Deprecated public static javax.faces.component.UIComponent provideLabel(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
@Deprecated public static void setValidator(javax.faces.component.EditableValueHolder editableValueHolder, String validator)
@Deprecated public static void setConverter(javax.faces.component.ValueHolder valueHolder, String converterId)
@Deprecated public static void setAction(javax.faces.component.ActionSource component, String action)
@Deprecated public static void setActionListener(javax.faces.component.ActionSource command, String actionListener)
@Deprecated public static void setValueChangeListener(javax.faces.component.EditableValueHolder valueHolder, String valueChangeListener)
@Deprecated public static void setValueBinding(javax.faces.component.UIComponent component, String name, String state)
@Deprecated public static String[] getMarkupBinding(javax.faces.context.FacesContext facesContext, SupportsMarkup component)
public static javax.faces.component.UIComponent findComponent(javax.faces.component.UIComponent from, String relativeId)
The search depends on the number of prefixed colons in the relativeId:
If a literal is specified: to use more than one identifier the identifiers must be space delimited.
public static String[] evaluateClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String[] componentIds)
public static String evaluateClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String componentId)
public static Object getConvertedValue(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, String stringValue)
public static Markup updateMarkup(javax.faces.component.UIComponent component, Markup markup)
public static Markup markupOfSeverity(javax.faces.application.FacesMessage.Severity maximumSeverity)
public static void addCurrentMarkup(SupportsMarkup component, Markup markup)
@Deprecated public static boolean hasChildrenWithMessages(javax.faces.context.FacesContext facesContext, javax.faces.component.NamingContainer container)
public static javax.faces.application.FacesMessage.Severity getMaximumSeverityOfChildrenMessages(javax.faces.context.FacesContext facesContext, javax.faces.component.NamingContainer container)
@Deprecated public static String[] getChildrenWithMessages(javax.faces.context.FacesContext facesContext, javax.faces.component.NamingContainer container)
public static void putDataAttributeWithPrefix(javax.faces.component.UIComponent component, String name, Object value)
public static void putDataAttribute(javax.faces.component.UIComponent component, Object name, Object value)
public static Map<Object,Object> getDataAttributes(javax.faces.component.UIComponent component)
public static Object getDataAttribute(javax.faces.component.UIComponent component, String name)
public static boolean invokeOnComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String clientId, javax.faces.component.ContextCallback callback)
UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String,
javax.faces.component.ContextCallback)
Copyright © 2002-2018 The Apache Software Foundation. All Rights Reserved.