public class DefaultComponentAgent extends java.lang.Object implements ComponentAgent
OperationAgentManager
.Constructor and Description |
---|
DefaultComponentAgent(PageAgent pageAgent,
org.zkoss.zk.ui.Component component) |
Modifier and Type | Method and Description |
---|---|
<T> T |
as(java.lang.Class<T> clazz)
Try to get a instance of target class for this query agent, the target class
is usually a
OperationAgent or a native Component if it cannot get a instance of target class, it will throw AgentException . |
void |
blur()
Blur this component, it is a short cut of
FocusAgent.blur()
If this component doesn't support FocusAgent , it will throw exception. |
void |
check(boolean checked)
Check this component, it is a short cut of
CheckAgent.check(boolean)
If this component doesn't support CheckAgent , it will throw exception. |
void |
click()
Click on this component, A short cut of
ClickAgent.click()
If this component doesn't support ClickAgent , it will throw exception. |
void |
dump() |
boolean |
equals(java.lang.Object obj) |
void |
focus()
Focus this component, it is a short cut of
FocusAgent.focus()
If this component doesn't support FocusAgent , it will throw exception. |
java.lang.Object |
getAttribute(java.lang.String name)
get attribute by specify name.
|
ComponentAgent |
getChild(int index)
get child by specify index.
|
java.util.List<ComponentAgent> |
getChildren()
get children agents.
|
Client |
getClient()
get client this agent belonged to.
|
java.lang.Object |
getDelegatee()
get the delegatee object
|
DesktopAgent |
getDesktop()
get desktop agent this component belonged to.
|
ComponentAgent |
getFirstChild()
Returns the first child, if any.
|
java.lang.String |
getId()
get ID.
|
ComponentAgent |
getLastChild()
Returns the last child, if any.
|
ComponentAgent |
getNextSibling()
Returns the next sibling, if any.
|
<T extends org.zkoss.zk.ui.Component> |
getOwner()
Returns the associated owner component of this agent
|
PageAgent |
getPage()
get page agent this component belonged to.
|
ComponentAgent |
getParent()
get parent agent.
|
ComponentAgent |
getPreviousSibling()
Returns the previous sibling, if any.
|
java.lang.String |
getType() |
java.lang.String |
getUuid()
get UUID.
|
int |
hashCode() |
void |
input(java.lang.Object value)
Input to this component, it is a short cut of
InputAgent.input(Object)
If this component doesn't support InputAgent , it will throw exception. |
<T> boolean |
is(java.lang.Class<T> clazz)
Can get a instance of target class for this query agent.
|
ComponentAgent |
query(java.lang.String selector)
to find the first component agent with the selector in this query agent.
|
java.util.List<ComponentAgent> |
queryAll(java.lang.String selector)
to find the component agents with the selector in this query agent.
|
void |
select()
Select this component, it is a short cut of
SelectAgent.select()
If this component doesn't support SelectAgent , it will throw exception. |
void |
stroke(java.lang.String key)
Stroke a key on this component, it is a short cut of
KeyStrokeAgent.stroke(String)
If this component doesn't support KeyStrokeAgent , it will throw exception. |
java.lang.String |
toString() |
void |
type(java.lang.String value)
Type on this component, it is a short cut of
InputAgent.type(String)
If this component doesn't support InputAgent , it will throw exception. |
public DefaultComponentAgent(PageAgent pageAgent, org.zkoss.zk.ui.Component component)
public java.lang.String getId()
ComponentAgent
getId
in interface ComponentAgent
public java.lang.String getType()
public java.lang.Object getAttribute(java.lang.String name)
ComponentAgent
getAttribute
in interface ComponentAgent
name
- attribute name.public java.lang.String getUuid()
ComponentAgent
getUuid
in interface ComponentAgent
public java.util.List<ComponentAgent> getChildren()
ComponentAgent
getChildren
in interface ComponentAgent
public ComponentAgent getFirstChild()
ComponentAgent
getFirstChild
in interface ComponentAgent
public ComponentAgent getLastChild()
ComponentAgent
getLastChild
in interface ComponentAgent
public ComponentAgent getNextSibling()
ComponentAgent
getNextSibling
in interface ComponentAgent
public ComponentAgent getPreviousSibling()
ComponentAgent
getPreviousSibling
in interface ComponentAgent
public ComponentAgent getChild(int index)
ComponentAgent
getChild
in interface ComponentAgent
public ComponentAgent getParent()
ComponentAgent
getParent
in interface ComponentAgent
public Client getClient()
Agent
public DesktopAgent getDesktop()
ComponentAgent
getDesktop
in interface ComponentAgent
public PageAgent getPage()
ComponentAgent
getPage
in interface ComponentAgent
public <T> T as(java.lang.Class<T> clazz)
QueryAgent
OperationAgent
or a native Component
AgentException
.as
in interface QueryAgent
clazz
- class of specify operation.public <T> boolean is(java.lang.Class<T> clazz)
QueryAgent
is
in interface QueryAgent
clazz
- the class cast to.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public ComponentAgent query(java.lang.String selector)
QueryAgent
query
in interface QueryAgent
selector
- the selectorpublic java.util.List<ComponentAgent> queryAll(java.lang.String selector)
QueryAgent
queryAll
in interface QueryAgent
selector
- the selectorpublic java.lang.String toString()
toString
in class java.lang.Object
public void dump()
public java.lang.Object getDelegatee()
Agent
getDelegatee
in interface Agent
public <T extends org.zkoss.zk.ui.Component> T getOwner()
ComponentAgent
getOwner
in interface ComponentAgent
public void click()
ComponentAgent
ClickAgent.click()
If this component doesn't support ClickAgent
, it will throw exception.click
in interface ComponentAgent
QueryAgent.as(Class)
,
ClickAgent
public void type(java.lang.String value)
ComponentAgent
InputAgent.type(String)
If this component doesn't support InputAgent
, it will throw exception.type
in interface ComponentAgent
QueryAgent.as(Class)
,
InputAgent
public void input(java.lang.Object value)
ComponentAgent
InputAgent.input(Object)
If this component doesn't support InputAgent
, it will throw exception.input
in interface ComponentAgent
QueryAgent.as(Class)
,
InputAgent
public void focus()
ComponentAgent
FocusAgent.focus()
If this component doesn't support FocusAgent
, it will throw exception.focus
in interface ComponentAgent
QueryAgent.as(Class)
,
FocusAgent
public void blur()
ComponentAgent
FocusAgent.blur()
If this component doesn't support FocusAgent
, it will throw exception.blur
in interface ComponentAgent
QueryAgent.as(Class)
,
FocusAgent
public void check(boolean checked)
ComponentAgent
CheckAgent.check(boolean)
If this component doesn't support CheckAgent
, it will throw exception.check
in interface ComponentAgent
QueryAgent.as(Class)
,
CheckAgent
public void stroke(java.lang.String key)
ComponentAgent
KeyStrokeAgent.stroke(String)
If this component doesn't support KeyStrokeAgent
, it will throw exception.stroke
in interface ComponentAgent
QueryAgent.as(Class)
,
KeyStrokeAgent
public void select()
ComponentAgent
SelectAgent.select()
If this component doesn't support SelectAgent
, it will throw exception.select
in interface ComponentAgent
QueryAgent.as(Class)
,
SelectAgent
Copyright © 2019 Potix Corporation. All rights reserved.