Package org.zkoss.zk.ui.select
Class Selectors
java.lang.Object
org.zkoss.zk.ui.select.Selectors
A collection of selector related utilities.
- Since:
- 6.0.0
- Author:
- simonpai
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of Components that match the selector (from the first page of current Desktop).Returns a list of Components that match the selector.Returns a list of Components that match the selector.Returns an Iterable that iterates through all Components matched by the selector.Returns an Iterable that iterates through all Components matched by the selector.static List<org.zkoss.xel.VariableResolver>newVariableResolvers(Class<?> cls, Class<?> untilClass) Creates a list of instances ofVariableResolverbased on the annotation of the given class.static voidrewireComponentsOnActivate(Component component, Object controller) Rewire the components on session activationstatic voidrewireVariablesOnActivate(Component component, Object controller, List<org.zkoss.xel.VariableResolver> extraResolvers) Rewire the variables on session activationstatic voidwireComponents(Component component, Object controller, boolean ignoreNonNull) Wire components to controller.static voidwireComponents(Page page, Object controller, boolean ignoreNonNull) Wire components to controller.static voidwireEventListeners(Component component, Object controller) Add event listeners to components based on the controller.static voidwireVariables(Component component, Object controller, List<org.zkoss.xel.VariableResolver> extraResolvers) Wire variables to controller, including XEL variables, implicit variables.static voidwireVariables(Page page, Object controller, List<org.zkoss.xel.VariableResolver> extraResolvers) Wire variables to controller, including XEL variables, implicit variables.
-
Constructor Details
-
Selectors
public Selectors()
-
-
Method Details
-
iterable
Returns an Iterable that iterates through all Components matched by the selector.- Parameters:
page- the reference page for selectorselector- the selector string- Returns:
- an Iterable of Component
-
iterable
Returns an Iterable that iterates through all Components matched by the selector.- Parameters:
root- the reference component for selectorselector- the selector string- Returns:
- an Iterable of Component
-
find
Returns a list of Components that match the selector.- Parameters:
page- the reference page for selectorselector- the selector string- Returns:
- a List of Component
-
find
Returns a list of Components that match the selector.- Parameters:
root- the reference component for selectorselector- the selector string- Returns:
- a List of Component
-
find
Returns a list of Components that match the selector (from the first page of current Desktop).- Parameters:
selector- the selector string- Returns:
- a List of Component
- Since:
- 9.5.0
-
wireVariables
public static void wireVariables(Component component, Object controller, List<org.zkoss.xel.VariableResolver> extraResolvers) Wire variables to controller, including XEL variables, implicit variables.- Parameters:
component- the reference componentcontroller- the controller object to be injected with variables
-
wireVariables
public static void wireVariables(Page page, Object controller, List<org.zkoss.xel.VariableResolver> extraResolvers) Wire variables to controller, including XEL variables, implicit variables.- Parameters:
page- the reference pagecontroller- the controller object to be injected with variables
-
wireComponents
Wire components to controller.- Parameters:
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.
-
wireComponents
Wire components to controller.- Parameters:
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.
-
rewireVariablesOnActivate
public static void rewireVariablesOnActivate(Component component, Object controller, List<org.zkoss.xel.VariableResolver> extraResolvers) Rewire the variables on session activation- Since:
- 7.0.7
-
rewireComponentsOnActivate
Rewire the components on session activation- Since:
- 7.0.7
-
wireEventListeners
Add event listeners to components based on the controller.- Parameters:
component- the reference component for selectorcontroller- the controller of event listening methods
-
newVariableResolvers
public static List<org.zkoss.xel.VariableResolver> newVariableResolvers(Class<?> cls, Class<?> untilClass) Creates a list of instances ofVariableResolverbased on the annotation of the given class. If no such annotation is found, an empty list is returned.- Parameters:
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.
-