org.zkoss.ztl
Class ClientWidget

java.lang.Object
  extended by org.openqa.selenium.By
      extended by org.zkoss.ztl.ClientWidget
Direct Known Subclasses:
Element, JQuery, Widget, ZK

public abstract class ClientWidget
extends org.openqa.selenium.By

The skeleton of ZK client side widget. It is used to manipulate a string buffer to concatenate an executed JavaScript code.

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
protected  java.lang.StringBuffer _out
           
 
Constructor Summary
ClientWidget()
           
 
Method Summary
 java.lang.String eval(java.lang.String script)
          Returns the result of the evaluation, if any.
 java.lang.String eval(java.lang.String script, boolean withDot)
          Returns the result of the evaluation, if any.
 java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.SearchContext context)
           
static boolean isBlank(java.lang.String s)
          Returns true if the string is null or empty or pure blank.
static boolean isEmpty(java.lang.String s)
          Returns true if the string is null or empty.
abstract  org.openqa.selenium.By toBy()
          Returns the element as By element, if possible.
abstract  Element toElement()
          Returns the element from this client widget.
 java.lang.String toLocator()
          Returns the evaluation string that is JavaScript format.
 java.lang.String toString()
          Returns the evaluation string that is JavaScript format.
protected  java.lang.String toUpperCase(java.lang.String key, java.lang.String name)
          Returns the string that the first word of the name is upper case.
 
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
 

Field Detail

_out

protected java.lang.StringBuffer _out
Constructor Detail

ClientWidget

public ClientWidget()
Method Detail

isEmpty

public static final boolean isEmpty(java.lang.String s)
Returns true if the string is null or empty.


isBlank

public static final boolean isBlank(java.lang.String s)
Returns true if the string is null or empty or pure blank.


toUpperCase

protected java.lang.String toUpperCase(java.lang.String key,
                                       java.lang.String name)
Returns the string that the first word of the name is upper case.

Parameters:
key - the prefix of the method name. Like set and get
name - the name of the method.

eval

public java.lang.String eval(java.lang.String script)
Returns the result of the evaluation, if any.

Parameters:
script - the JavaScript code
See Also:
eval(String, boolean)

eval

public java.lang.String eval(java.lang.String script,
                             boolean withDot)
Returns the result of the evaluation, if any.

Parameters:
script - The JavaScript code
withDot - if true, the dot '.' is added before the script.

toLocator

public java.lang.String toLocator()
Returns the evaluation string that is JavaScript format.


toString

public java.lang.String toString()
Returns the evaluation string that is JavaScript format.

Overrides:
toString in class org.openqa.selenium.By

toElement

public abstract Element toElement()
Returns the element from this client widget.

Since:
2.0.0

toBy

public abstract org.openqa.selenium.By toBy()
Returns the element as By element, if possible.

Since:
2.0.1

findElements

public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.SearchContext context)
Specified by:
findElements in class org.openqa.selenium.By


Copyright © 2015. All Rights Reserved.