Package org.zkoss.zats.mimic.impl
Class DefaultComponentAgent
java.lang.Object
org.zkoss.zats.mimic.impl.DefaultComponentAgent
- All Implemented Interfaces:
Agent,ComponentAgent,QueryAgent
The default implement of component agent. This performs operations through
OperationAgentManager.- Author:
- pao
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultComponentAgent(PageAgent pageAgent, org.zkoss.zk.ui.Component component) -
Method Summary
Modifier and TypeMethodDescription<T> TTry 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.voidblur()Blur this component, it is a short cut ofFocusAgent.blur()voidcheck(boolean checked) Check this component, it is a short cut ofCheckAgent.check(boolean)voidclick()Click on this component, A short cut ofClickAgent.click()voiddump()booleanvoidfocus()Focus this component, it is a short cut ofFocusAgent.focus()getAttribute(String name) get attribute by specify name.getChild(int index) get child by specify index.get children agents.get client this agent belonged to.get the delegatee objectget desktop agent this component belonged to.Returns the first child, if any.getId()get ID.Returns the last child, if any.Returns the next sibling, if any.<T extends org.zkoss.zk.ui.Component>
TgetOwner()Returns the associated owner component of this agentgetPage()get page agent this component belonged to.get parent agent.Returns the previous sibling, if any.getType()getUuid()get UUID.inthashCode()voidInput to this component, it is a short cut ofInputAgent.input(Object)<T> booleanCan get a instance of target class for this query agent.to find the first component agent with the selector in this query agent.to find the component agents with the selector in this query agent.voidselect()Select this component, it is a short cut ofSelectAgent.select()voidStroke a key on this component, it is a short cut ofKeyStrokeAgent.stroke(String)toString()voidType on this component, it is a short cut ofInputAgent.type(String)
-
Constructor Details
-
DefaultComponentAgent
-
-
Method Details
-
getId
Description copied from interface:ComponentAgentget ID. of the component.- Specified by:
getIdin interfaceComponentAgent- Returns:
- ID or null if it hasn't.
-
getType
-
getAttribute
Description copied from interface:ComponentAgentget attribute by specify name.- Specified by:
getAttributein interfaceComponentAgent- Parameters:
name- attribute name.- Returns:
- attribute value or null if not found or otherwise.
-
getUuid
Description copied from interface:ComponentAgentget UUID. of the component.- Specified by:
getUuidin interfaceComponentAgent- Returns:
- UUID.
-
getChildren
Description copied from interface:ComponentAgentget children agents.- Specified by:
getChildrenin interfaceComponentAgent- Returns:
- always return a list of children (may be empty).
-
getFirstChild
Description copied from interface:ComponentAgentReturns the first child, if any.- Specified by:
getFirstChildin interfaceComponentAgent- Returns:
- the first child agent or null.
-
getLastChild
Description copied from interface:ComponentAgentReturns the last child, if any.- Specified by:
getLastChildin interfaceComponentAgent- Returns:
- the last child agent or null.
-
getNextSibling
Description copied from interface:ComponentAgentReturns the next sibling, if any.- Specified by:
getNextSiblingin interfaceComponentAgent- Returns:
- the next sibling agent or null.
-
getPreviousSibling
Description copied from interface:ComponentAgentReturns the previous sibling, if any.- Specified by:
getPreviousSiblingin interfaceComponentAgent- Returns:
- the previous sibling agent or null.
-
getChild
Description copied from interface:ComponentAgentget child by specify index.- Specified by:
getChildin interfaceComponentAgent- Returns:
- child agent or null if index is out of boundary.
-
getParent
Description copied from interface:ComponentAgentget parent agent.- Specified by:
getParentin interfaceComponentAgent- Returns:
- parent agent or null if this is root agent.
-
getClient
Description copied from interface:Agentget client this agent belonged to. -
getDesktop
Description copied from interface:ComponentAgentget desktop agent this component belonged to.- Specified by:
getDesktopin interfaceComponentAgent- Returns:
- desktop agent.
-
getPage
Description copied from interface:ComponentAgentget page agent this component belonged to.- Specified by:
getPagein interfaceComponentAgent- Returns:
- page agent.
-
as
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
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
-
hashCode
public int hashCode() -
equals
-
query
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
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
-
toString
-
dump
public void dump() -
getDelegatee
Description copied from interface:Agentget the delegatee object- Specified by:
getDelegateein interfaceAgent
-
getOwner
public <T extends org.zkoss.zk.ui.Component> T getOwner()Description copied from interface:ComponentAgentReturns the associated owner component of this agent- Specified by:
getOwnerin interfaceComponentAgent- Returns:
-
click
public void click()Description copied from interface:ComponentAgentClick on this component, A short cut ofClickAgent.click()If this component doesn't supportClickAgent, it will throw exception.- Specified by:
clickin interfaceComponentAgent- See Also:
-
type
Description copied from interface:ComponentAgentType on this component, it is a short cut ofInputAgent.type(String)If this component doesn't supportInputAgent, it will throw exception.- Specified by:
typein interfaceComponentAgent- See Also:
-
input
Description copied from interface:ComponentAgentInput to this component, it is a short cut ofInputAgent.input(Object)If this component doesn't supportInputAgent, it will throw exception.- Specified by:
inputin interfaceComponentAgent- See Also:
-
focus
public void focus()Description copied from interface:ComponentAgentFocus this component, it is a short cut ofFocusAgent.focus()If this component doesn't supportFocusAgent, it will throw exception.- Specified by:
focusin interfaceComponentAgent- See Also:
-
blur
public void blur()Description copied from interface:ComponentAgentBlur this component, it is a short cut ofFocusAgent.blur()If this component doesn't supportFocusAgent, it will throw exception.- Specified by:
blurin interfaceComponentAgent- See Also:
-
check
public void check(boolean checked) Description copied from interface:ComponentAgentCheck this component, it is a short cut ofCheckAgent.check(boolean)If this component doesn't supportCheckAgent, it will throw exception.- Specified by:
checkin interfaceComponentAgent- See Also:
-
stroke
Description copied from interface:ComponentAgentStroke a key on this component, it is a short cut ofKeyStrokeAgent.stroke(String)If this component doesn't supportKeyStrokeAgent, it will throw exception.- Specified by:
strokein interfaceComponentAgent- See Also:
-
select
public void select()Description copied from interface:ComponentAgentSelect this component, it is a short cut ofSelectAgent.select()If this component doesn't supportSelectAgent, it will throw exception.- Specified by:
selectin interfaceComponentAgent- See Also:
-