Package org.zkoss.zats.mimic.impl
Class DefaultPageAgent
- java.lang.Object
-
- org.zkoss.zats.mimic.impl.DefaultPageAgent
-
- All Implemented Interfaces:
Agent,PageAgent,QueryAgent
public class DefaultPageAgent extends Object implements PageAgent
Default implementation for PageAgent.
-
-
Constructor Summary
Constructors Constructor Description DefaultPageAgent(DesktopAgent desktopAgent, org.zkoss.zk.ui.Page page)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tas(Class<T> clazz)Try to get a instance of target class for this query agent, the target class is usually aOperationAgentor a nativeComponent
if it cannot get a instance of target class, it will throwAgentException.booleanequals(Object obj)ObjectgetAttribute(String name)get attribute by specify name.ClientgetClient()get client this agent belonged to.ObjectgetDelegatee()get the delegatee objectDesktopAgentgetDesktop()get desktop of this pageStringgetId()get ID.org.zkoss.zk.ui.PagegetPage()List<ComponentAgent>getRoots()get root component agents at the page.StringgetType()StringgetUuid()get UUID.inthashCode()<T> booleanis(Class<T> clazz)Can get a instance of target class for this query agent.ComponentAgentquery(String selector)to find the first component agent with the selector in this query agent.List<ComponentAgent>queryAll(String selector)to find the component agents with the selector in this query agent.StringtoString()
-
-
-
Constructor Detail
-
DefaultPageAgent
public DefaultPageAgent(DesktopAgent desktopAgent, org.zkoss.zk.ui.Page page)
-
-
Method Detail
-
getType
public String getType()
-
getAttribute
public Object getAttribute(String name)
Description copied from interface:PageAgentget attribute by specify name.- Specified by:
getAttributein interfacePageAgent- Parameters:
name- attribute name.- Returns:
- attribute value or null if not found or otherwise.
-
getUuid
public String getUuid()
Description copied from interface:PageAgentget UUID. of this the page.
-
getRoots
public List<ComponentAgent> getRoots()
Description copied from interface:PageAgentget root component agents at the page.
-
getClient
public Client getClient()
Description copied from interface:Agentget client this agent belonged to.
-
getDesktop
public DesktopAgent getDesktop()
Description copied from interface:PageAgentget desktop of this page- Specified by:
getDesktopin interfacePageAgent
-
getPage
public org.zkoss.zk.ui.Page getPage()
-
getDelegatee
public Object getDelegatee()
Description copied from interface:Agentget the delegatee object- Specified by:
getDelegateein interfaceAgent
-
query
public ComponentAgent query(String selector)
Description copied from interface:QueryAgentto find the first component agent with the selector in this query agent.- Specified by:
queryin interfaceQueryAgent- Parameters:
selector- the selector- Returns:
- the first component agent, null if not found
-
queryAll
public List<ComponentAgent> queryAll(String selector)
Description copied from interface:QueryAgentto find the component agents with the selector in this query agent.- Specified by:
queryAllin interfaceQueryAgent- Parameters:
selector- the selector- Returns:
- the component agents
-
as
public <T> T as(Class<T> clazz)
Description copied from interface:QueryAgentTry to get a instance of target class for this query agent, the target class is usually aOperationAgentor a nativeComponent
if it cannot get a instance of target class, it will throwAgentException.- Specified by:
asin interfaceQueryAgent- Parameters:
clazz- class of specify operation.- Returns:
- operation object.
-
is
public <T> boolean is(Class<T> clazz)
Description copied from interface:QueryAgentCan get a instance of target class for this query agent.- Specified by:
isin interfaceQueryAgent- Parameters:
clazz- the class cast to.- Returns:
- true if can get a instance of target class
-
-