public class ComponentsManager extends AbstractComponentInstantiator implements ComponentInstantiator, ComponentsAccessor, ProxyElementListener
A component is an Object implementing no particular interface, but capable a wrapping
a WebElement.
FluentWebElement is the most common component.
| Constructor and Description |
|---|
ComponentsManager(FluentControl control)
Creates a new components manager.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addComponentsListener(ComponentsListener listener)
Add a component listener to be notified when a component is registered or unregistered.
|
<L extends java.util.List<T>,T> |
asComponentList(java.lang.Class<L> listClass,
java.lang.Class<T> componentClass,
java.lang.Iterable<org.openqa.selenium.WebElement> elementList)
Create and register a new list of component from the given element iterable.
|
protected void |
fireComponentRegistered(org.openqa.selenium.WebElement element,
java.lang.Object component)
Fire component registered event.
|
protected void |
fireComponentReleased(org.openqa.selenium.WebElement element,
java.lang.Object component)
Fire component released event.
|
java.util.Set<java.lang.Object> |
getComponents(org.openqa.selenium.WebElement element)
Get the related components from the given element.
|
ComponentInstantiator |
getInstantiator()
Get the component instantiator used by this components manager.
|
boolean |
isComponentClass(java.lang.Class<?> componentClass)
Check if this class is a component class.
|
boolean |
isComponentListClass(java.lang.Class<? extends java.util.List<?>> componentListClass)
Check if this class is a component list class.
|
<T> T |
newComponent(java.lang.Class<T> componentClass,
org.openqa.selenium.WebElement element)
Create and register a new component from the given element.
|
<L extends java.util.List<T>,T> |
newComponentList(java.lang.Class<L> listClass,
java.lang.Class<T> componentClass,
java.util.List<T> componentsList)
Create and register a new list of component from the given component list.
|
void |
proxyElementFound(java.lang.Object proxy,
org.openqa.selenium.support.pagefactory.ElementLocator locator,
java.util.List<org.openqa.selenium.WebElement> elements)
Invoked when proxy element search is over and elements were found.
|
void |
proxyElementSearch(java.lang.Object proxy,
org.openqa.selenium.support.pagefactory.ElementLocator locator)
Invoked when proxy element search is starting.
|
void |
release()
Release this manager.
|
boolean |
removeComponentsListener(ComponentsListener listener)
Remove a component listener.
|
asComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newFluent, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newFluentListclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasComponentList, asComponentList, asComponentList, asComponentList, asComponentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, asFluentList, newComponentList, newComponentList, newComponentList, newComponentList, newComponentList, newFluent, newFluentList, newFluentList, newFluentList, newFluentList, newFluentList, newFluentListpublic ComponentsManager(FluentControl control)
control - control interfacepublic ComponentInstantiator getInstantiator()
public java.util.Set<java.lang.Object> getComponents(org.openqa.selenium.WebElement element)
ComponentsAccessorgetComponents in interface ComponentsAccessorelement - selenium elementpublic boolean isComponentClass(java.lang.Class<?> componentClass)
ComponentInstantiatorisComponentClass in interface ComponentInstantiatorcomponentClass - class to checkpublic boolean isComponentListClass(java.lang.Class<? extends java.util.List<?>> componentListClass)
ComponentInstantiatorisComponentListClass in interface ComponentInstantiatorcomponentListClass - class to checkpublic <T> T newComponent(java.lang.Class<T> componentClass,
org.openqa.selenium.WebElement element)
ComponentInstantiatornewComponent in interface ComponentInstantiatorT - type of the componentcomponentClass - type of the componentelement - wrapped elementpublic boolean addComponentsListener(ComponentsListener listener)
ComponentsAccessoraddComponentsListener in interface ComponentsAccessorlistener - components listenerpublic boolean removeComponentsListener(ComponentsListener listener)
ComponentsAccessorremoveComponentsListener in interface ComponentsAccessorlistener - components listener to removeprotected void fireComponentRegistered(org.openqa.selenium.WebElement element,
java.lang.Object component)
element - underlying elementcomponent - registered componentprotected void fireComponentReleased(org.openqa.selenium.WebElement element,
java.lang.Object component)
element - underlying elementcomponent - released componentpublic <L extends java.util.List<T>,T> L newComponentList(java.lang.Class<L> listClass,
java.lang.Class<T> componentClass,
java.util.List<T> componentsList)
ComponentInstantiatornewComponentList in interface ComponentInstantiatorL - type of the listT - type of the componentlistClass - type of the listcomponentClass - type of the componentcomponentsList - components listpublic <L extends java.util.List<T>,T> L asComponentList(java.lang.Class<L> listClass,
java.lang.Class<T> componentClass,
java.lang.Iterable<org.openqa.selenium.WebElement> elementList)
ComponentInstantiatorasComponentList in interface ComponentInstantiatorasComponentList in class AbstractComponentInstantiatorL - type of the listT - type of the componentlistClass - type of the listcomponentClass - type of the componentelementList - elementspublic void proxyElementSearch(java.lang.Object proxy,
org.openqa.selenium.support.pagefactory.ElementLocator locator)
ProxyElementListenerproxyElementSearch in interface ProxyElementListenerproxy - proxylocator - element locatorpublic void proxyElementFound(java.lang.Object proxy,
org.openqa.selenium.support.pagefactory.ElementLocator locator,
java.util.List<org.openqa.selenium.WebElement> elements)
ProxyElementListenerproxyElementFound in interface ProxyElementListenerproxy - proxylocator - element locatorelements - found elementspublic void release()
Copyright © 2018 FluentLenium. All Rights Reserved.