Package org.zkoss.stateless.ui
Interface Locator
- All Known Implementing Classes:
Self
public interface Locator
An interface to indicate an opaque reference to the location information of
IComponents
at client side.- Author:
- jumperchen
-
Method Summary
Modifier and TypeMethodDescriptionchild(int nth) Returns the first locator that is the nth child of the locator.closest(Class<? extends IComponent> iClass) Traverses the locator and its parents until it finds a widget that matches the provided selector iClass.find(Class<? extends IComponent> selector) Returns the first locator that is a descendant of the locator on which it is invoked that matches the specified class.findChild(Class<? extends IComponent> selector) Returns the first locator that is a direct child of the locator on which it is invoked that matches the specified class.Returns the first child of the locator on which it is invoked that matches the specified class.Returns the last child of the locator on which it is invoked that matches the specified class.Returns the next sibling of the locator on which it is invoked that matches the specified class.static <I extends IComponent>
Locatorof(I iComponent) Returns a locator to the givenIComponent.static <T extends org.zkoss.zk.ui.Component>
LocatorReturns a locator to the given uuid.static <T extends org.zkoss.zk.ui.Component>
Locatorof(T component) Returns a locator to the givenComponent.static <T extends org.zkoss.zk.ui.Component>
LocatorReturns a locator to the given id ofIComponent.Returns the previous sibling of the locator on which it is invoked that matches the specified class.org.zkoss.zk.ui.ComponentConverts this locator to ZK Component forClientsAPI to use.org.zkoss.zk.ui.ComponenttoComponent(CheckedConsumer2<org.zkoss.zk.ui.event.Event, org.zkoss.zk.ui.ext.Scope> eventHandlers) Converts this locator to ZK Component forEvents.postEvent(Event)API to use.Returns the string representation of a specified locator
-
Method Details
-
closest
Traverses the locator and its parents until it finds a widget that matches the provided selector iClass. Will return the locator of itself or the matching ancestor. If no such widget exists, it means nothing.- Returns:
-
toComponent
org.zkoss.zk.ui.Component toComponent()Converts this locator to ZK Component forClientsAPI to use.- Returns:
-
toComponent
org.zkoss.zk.ui.Component toComponent(CheckedConsumer2<org.zkoss.zk.ui.event.Event, org.zkoss.zk.ui.ext.Scope> eventHandlers) Converts this locator to ZK Component forEvents.postEvent(Event)API to use. -
toExternalForm
String toExternalForm()Returns the string representation of a specified locator -
find
Returns the first locator that is a descendant of the locator on which it is invoked that matches the specified class.- Returns:
-
findChild
Returns the first locator that is a direct child of the locator on which it is invoked that matches the specified class.- Returns:
-
child
Returns the first locator that is the nth child of the locator.- Parameters:
nth- 0-based- Returns:
-
previousSibling
Locator previousSibling()Returns the previous sibling of the locator on which it is invoked that matches the specified class.- Returns:
-
nextSibling
Locator nextSibling()Returns the next sibling of the locator on which it is invoked that matches the specified class.- Returns:
-
firstChild
Locator firstChild()Returns the first child of the locator on which it is invoked that matches the specified class.- Returns:
-
lastChild
Locator lastChild()Returns the last child of the locator on which it is invoked that matches the specified class.- Returns:
-
of
Returns a locator to the givenIComponent. Note: The id of the component cannot be null.- Returns:
-
of
Returns a locator to the givenComponent. Note: The uuid of the component cannot be null.- Returns:
-
of
Returns a locator to the given uuid. Note: The uuid cannot be null.- Returns:
-
ofId
Returns a locator to the given id ofIComponent. Note: The id cannot be null.- Returns:
-