org.zkoss.ztl
Class Widget

java.lang.Object
  extended by org.openqa.selenium.By
      extended by org.zkoss.ztl.ClientWidget
          extended by org.zkoss.ztl.Widget

public class Widget
extends ClientWidget

A simulator of the ZK client widget.

Author:
jumperchen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openqa.selenium.By
org.openqa.selenium.By.ByClassName, org.openqa.selenium.By.ByCssSelector, org.openqa.selenium.By.ById, org.openqa.selenium.By.ByLinkText, org.openqa.selenium.By.ByName, org.openqa.selenium.By.ByPartialLinkText, org.openqa.selenium.By.ByTagName, org.openqa.selenium.By.ByXPath
 
Field Summary
 
Fields inherited from class org.zkoss.ztl.ClientWidget
_out
 
Constructor Summary
Widget(JQuery jquery)
           
Widget(java.lang.String uuid)
           
Widget(java.lang.StringBuffer out)
           
Widget(java.lang.StringBuffer out, java.lang.String script)
           
 
Method Summary
 Widget $f(java.lang.String id)
          Returns the fellow of the widget from the given id.
 Element $n()
          Returns the element of the widget.
 Element $n(java.lang.String subname)
          Returns the sub-element of the widget from the given sub-name.
 Widget $o()
          Returns the id-space-owner of the widget.
 void detach()
          Detaches the widget
 boolean exists()
          Returns whether the widget exists or not.
 Widget firstChild()
          Returns the first child of the widget.
 java.lang.String get(java.lang.String name)
          Returns the value of the evaluated name.
 Widget getChild(java.lang.String name)
          Returns the child of the widget from the given name.
 java.lang.String id()
          Returns the id of the widget.
 boolean is(java.lang.String name)
          Returns the boolean value of the evaluated name.
 Widget lastChild()
          Returns the last child of the widget.
 int nChildren()
          Returns the size of the children.
 Widget nextSibling()
          Returns the next sibling of the widget.
 Widget previousSibling()
          Returns the previous sibling of the widget.
 void set(java.lang.String name, boolean value)
          Sets the boolean value to the evaluated name.
 void set(java.lang.String name, int value)
          Sets the number value to the evaluated name.
 void set(java.lang.String name, java.lang.String value)
          Sets the string value to the evaluated name.
 org.openqa.selenium.By toBy()
          Returns the element as By element, if possible.
 Element toElement()
          Returns the element from this client widget.
 java.lang.String uuid()
          Returns the uuid of the widget.
 
Methods inherited from class org.zkoss.ztl.ClientWidget
eval, eval, findElements, isBlank, isEmpty, toLocator, toString, toUpperCase
 
Methods inherited from class org.openqa.selenium.By
className, cssSelector, equals, findElement, hashCode, id, linkText, name, partialLinkText, tagName, xpath
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Widget

public Widget(java.lang.String uuid)

Widget

public Widget(JQuery jquery)

Widget

public Widget(java.lang.StringBuffer out)

Widget

public Widget(java.lang.StringBuffer out,
              java.lang.String script)
Method Detail

set

public void set(java.lang.String name,
                boolean value)
Sets the boolean value to the evaluated name.

For example,

listitem.set("selected", true);

Parameters:
name - any allowed property of the widget.
value - true or false.

set

public void set(java.lang.String name,
                int value)
Sets the number value to the evaluated name.

For example,

listbox.set("rows", 12);

Parameters:
name - any allowed property of the widget.
value - any number.

set

public void set(java.lang.String name,
                java.lang.String value)
Sets the string value to the evaluated name.

For example,

grid.set("width", "100px");

Parameters:
name - any allowed property of the widget.

uuid

public java.lang.String uuid()
Returns the uuid of the widget.


id

public java.lang.String id()
Returns the id of the widget.


get

public java.lang.String get(java.lang.String name)
Returns the value of the evaluated name.

For example,
grid.get("width");
in JavaScript
grid.getWidth();

Parameters:
name - any allowed property of the widget.

is

public boolean is(java.lang.String name)
Returns the boolean value of the evaluated name.

For example,
grid.is("vflex");
in JavaScript
grid.isVflex();

Parameters:
name - any allowed property of the widget.

getChild

public Widget getChild(java.lang.String name)
Returns the child of the widget from the given name.

For example,

Widget rows = grid.getChild("rows");


nChildren

public int nChildren()
Returns the size of the children.


lastChild

public Widget lastChild()
Returns the last child of the widget.


firstChild

public Widget firstChild()
Returns the first child of the widget.


nextSibling

public Widget nextSibling()
Returns the next sibling of the widget.


previousSibling

public Widget previousSibling()
Returns the previous sibling of the widget.


$f

public Widget $f(java.lang.String id)
Returns the fellow of the widget from the given id.


$o

public Widget $o()
Returns the id-space-owner of the widget.


$n

public Element $n()
Returns the element of the widget.


$n

public Element $n(java.lang.String subname)
Returns the sub-element of the widget from the given sub-name.


toElement

public Element toElement()
Description copied from class: ClientWidget
Returns the element from this client widget.

Specified by:
toElement in class ClientWidget

detach

public void detach()
Detaches the widget


exists

public boolean exists()
Returns whether the widget exists or not.


toBy

public org.openqa.selenium.By toBy()
Description copied from class: ClientWidget
Returns the element as By element, if possible.

Specified by:
toBy in class ClientWidget


Copyright © 2015. All Rights Reserved.