public class Selectors
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Selectors.ComposerEventListener |
Constructor and Description |
---|
Selectors() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Component> |
find(Component root,
java.lang.String selector)
Returns a list of Components that match the selector.
|
static java.util.List<Component> |
find(Page page,
java.lang.String selector)
Returns a list of Components that match the selector.
|
static java.lang.Iterable<Component> |
iterable(Component root,
java.lang.String selector)
Returns an Iterable that iterates through all Components matched by the
selector.
|
static java.lang.Iterable<Component> |
iterable(Page page,
java.lang.String selector)
Returns an Iterable that iterates through all Components matched by the
selector.
|
static java.util.List<VariableResolver> |
newVariableResolvers(java.lang.Class<?> cls,
java.lang.Class<?> untilClass)
Creates a list of instances of
VariableResolver based
on the annotation of the given class. |
static void |
rewireComponentsOnActivate(Component component,
java.lang.Object controller)
Rewire the components on session activation
|
static void |
rewireVariablesOnActivate(Component component,
java.lang.Object controller,
java.util.List<VariableResolver> extraResolvers)
Rewire the variables on session activation
|
static void |
wireComponents(Component component,
java.lang.Object controller,
boolean ignoreNonNull)
Wire components to controller.
|
static void |
wireComponents(Page page,
java.lang.Object controller,
boolean ignoreNonNull)
Wire components to controller.
|
static void |
wireEventListeners(Component component,
java.lang.Object controller)
Add event listeners to components based on the controller.
|
static void |
wireVariables(Component component,
java.lang.Object controller,
java.util.List<VariableResolver> extraResolvers)
Wire variables to controller, including XEL variables, implicit variables.
|
static void |
wireVariables(Page page,
java.lang.Object controller,
java.util.List<VariableResolver> extraResolvers)
Wire variables to controller, including XEL variables, implicit variables.
|
public static java.lang.Iterable<Component> iterable(Page page, java.lang.String selector)
page
- the reference page for selectorselector
- the selector stringpublic static java.lang.Iterable<Component> iterable(Component root, java.lang.String selector)
root
- the reference component for selectorselector
- the selector stringpublic static java.util.List<Component> find(Page page, java.lang.String selector)
page
- the reference page for selectorselector
- the selector stringpublic static java.util.List<Component> find(Component root, java.lang.String selector)
root
- the reference component for selectorselector
- the selector stringpublic static void wireVariables(Component component, java.lang.Object controller, java.util.List<VariableResolver> extraResolvers)
component
- the reference componentcontroller
- the controller object to be injected with variablespublic static void wireVariables(Page page, java.lang.Object controller, java.util.List<VariableResolver> extraResolvers)
page
- the reference pagecontroller
- the controller object to be injected with variablespublic static void wireComponents(Component component, java.lang.Object controller, boolean ignoreNonNull)
component
- the reference component for selectorcontroller
- the controller object to be injected with variablesignoreNonNull
- ignore wiring when the value of the field is a
Component (non-null) or a non-empty Collection.public static void wireComponents(Page page, java.lang.Object controller, boolean ignoreNonNull)
page
- the reference page for selectorcontroller
- the controller object to be injected with variablesignoreNonNull
- ignore wiring when the value of the field is a
Component (non-null) or a non-empty Collection.public static void rewireVariablesOnActivate(Component component, java.lang.Object controller, java.util.List<VariableResolver> extraResolvers)
public static void rewireComponentsOnActivate(Component component, java.lang.Object controller)
public static void wireEventListeners(Component component, java.lang.Object controller)
component
- the reference component for selectorcontroller
- the controller of event listening methodspublic static java.util.List<VariableResolver> newVariableResolvers(java.lang.Class<?> cls, java.lang.Class<?> untilClass)
VariableResolver
based
on the annotation of the given class.
If no such annotation is found, an empty list is returned.cls
- the class to look for the annotation.untilClass
- the class to stop the searching.
By default, it will look for the annotation of the super class if not found.
Ignored if null.Copyright © 2005-2011 Potix Corporation. All Rights Reserved.