Java Doc for DomQuery.java in  » Ajax » gwtext-2.01 » com » gwtext » client » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » gwtext 2.01 » com.gwtext.client.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.gwtext.client.core.DomQuery

DomQuery
public class DomQuery (Code)
Provides high performance selector/xpath processing by compiling queries into reusable functions. New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).

DomQuery supports most of the CSS3 selectors spec, along with some custom selectors and basic XPath.

All selectors, attribute filters and pseudos below can be combined infinitely in any order. For example "div.foo:nth-child(odd)[@foo=bar].bar:first" would be a perfectly valid selector. Node filters are processed in the order in which they appear, which allows you to optimize your queries for your document structure.

Element Selectors:

  • * any element
  • E an element with the tag E
  • E F All descendent elements of E that have the tag F
  • E > F or E/F all direct children elements of E that have the tag F
  • E + F all elements with the tag F that are immediately preceded by an element with the tag E
  • E ~ F all elements with the tag F that are preceded by a sibling element with the tag E

Attribute Selectors:

The use of @ and quotes are optional. For example, div[@foo='bar'] is also a valid attribute selector.

  • E[foo] has an attribute "foo"
  • E[foo=bar] has an attribute "foo" that equals "bar"
  • E[foo^=bar] has an attribute "foo" that starts with "bar"
  • E[foo$=bar] has an attribute "foo" that ends with "bar"
  • E[foo*=bar] has an attribute "foo" that contains the substring "bar"
  • E[foo%=2] has an attribute "foo" that is evenly divisible by 2
  • E[foo!=bar] has an attribute "foo" that does not equal "bar"

Pseudo Classes:

  • E:first-child E is the first child of its parent
  • E:last-child E is the last child of its parent
  • E:nth-child(n) E is the nth child of its parent (1 based as per the spec)
  • E:nth-child(odd) E is an odd child of its parent
  • E:nth-child(even) E is an even child of its parent
  • E:only-child E is the only child of its parent
  • E:checked E is an element that is has a checked attribute that is true (e.g. a radio or checkbox)
  • E:first the first E in the resultset
  • E:last the last E in the resultset
  • E:nth(n) the nth E in the resultset (1 based)
  • E:odd shortcut for :nth-child(odd)
  • E:even shortcut for :nth-child(even)
  • E:contains(foo) E's innerHTML contains the substring "foo"
  • E:nodeValue(foo) E contains a textNode with a nodeValue that equals "foo"
  • E:not(S) an E element that does not match simple selector S
  • E:has(S) an E element that has a descendent that matches simple selector S
  • E:next(S) an E element whose next sibling matches simple selector S
  • E:prev(S) an E element whose previous sibling matches simple selector S

CSS Value Selectors:

  • E{display=none} css value "display" that equals "none"
  • E{display^=none} css value "display" that starts with "none"
  • E{display$=none} css value "display" that ends with "none"
  • E{display*=none} css value "display" that contains the substring "none"
  • E{display%=2} css value "display" that is evenly divisible by 2
  • E{display!=none} css value "display" that does not equal "none"



Inner Class :public static class SelectorType

Field Summary
public static  SelectorTypeSELECT
    
public static  SelectorTypeSIMPLE
    


Method Summary
public static  DomQueryFunctioncompile(String selector)
     Compiles a selector/xpath query into a reusable function.
public static  DomQueryFunctioncompile(String selector, SelectorType type)
     Compiles a selector/xpath query into a reusable function.
public static  Element[]filter(Element[] els, String selector, boolean nonMatches)
     Filters an array of elements to only include matches of a simple selector (e.g.
native public static  booleanis(String id, String selector)
     Returns true if the passed element match the passed simple selector (e.g.
native public static  booleanis(Element el, String selector)
     Returns true if the passed element match the passed simple selector (e.g.
public static  booleanis(Element[] els, String selector)
     Returns true if the passed elements match the passed simple selector (e.g.
public static  Element[]select(String selector)
     Selects a group of elements.
public static  Element[]select(String selector, Element root)
     Selects a group of elements.
native public static  ElementselectNode(String selector)
     Selects a single element.
native public static  ElementselectNode(String selector, Element root)
     Selects a single element.
Parameters:
  selector - the selector/xpath query
Parameters:
  root - the start of the query (defaults to document).
native public static  floatselectNumber(String selector)
     Selects the value of a node, parsing integers and floats.
native public static  floatselectNumber(String selector, Element root)
     Selects the value of a node, parsing integers and floats.
native public static  StringselectValue(String selector)
     Selects the value of a node.
native public static  StringselectValue(String selector, Element root)
    
native public static  StringselectValue(String selector, Element root, String defaultValue)
    

Field Detail
SELECT
public static SelectorType SELECT(Code)



SIMPLE
public static SelectorType SIMPLE(Code)





Method Detail
compile
public static DomQueryFunction compile(String selector)(Code)
Compiles a selector/xpath query into a reusable function. The returned function takes one parameter "root" (optional), which is the context node from where the query should start.
Parameters:
  selector - the selector/xpath query the reusable dom query function



compile
public static DomQueryFunction compile(String selector, SelectorType type)(Code)
Compiles a selector/xpath query into a reusable function. The returned function takes one parameter "root" (optional), which is the context node from where the query should start.
Parameters:
  selector - the selector/xpath query
Parameters:
  type - either DomQuery.SELECT (the default) or DomQuery.SIMPLE for a simple selector match the reusable dom query function



filter
public static Element[] filter(Element[] els, String selector, boolean nonMatches)(Code)
Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child).
Parameters:
  els - an array of elements to filter
Parameters:
  selector - the simple selector to test
Parameters:
  nonMatches - if true, it returns the elements that DON'T match the selector instead of the ones that match filtered element array



is
native public static boolean is(String id, String selector)(Code)
Returns true if the passed element match the passed simple selector (e.g. div.some-class or span:first-child).
Parameters:
  id - the element id
Parameters:
  selector - the simple selector to test true if matched



is
native public static boolean is(Element el, String selector)(Code)
Returns true if the passed element match the passed simple selector (e.g. div.some-class or span:first-child).
Parameters:
  el - the element
Parameters:
  selector - the simple selector to test true if matched



is
public static boolean is(Element[] els, String selector)(Code)
Returns true if the passed elements match the passed simple selector (e.g. div.some-class or span:first-child).
Parameters:
  els - the element array
Parameters:
  selector - the simple selector to test true if matched



select
public static Element[] select(String selector)(Code)
Selects a group of elements.
Parameters:
  selector - the selector/xpath query (can be a comma separated list of selectors) array of selected elements



select
public static Element[] select(String selector, Element root)(Code)
Selects a group of elements.
Parameters:
  selector - the selector/xpath query (can be a comma separated list of selectors)
Parameters:
  root - the start of the query (defaults to document) array of selected elements



selectNode
native public static Element selectNode(String selector)(Code)
Selects a single element.
Parameters:
  selector - the selector/xpath query the selected element



selectNode
native public static Element selectNode(String selector, Element root)(Code)
Selects a single element.
Parameters:
  selector - the selector/xpath query
Parameters:
  root - the start of the query (defaults to document). the selected element



selectNumber
native public static float selectNumber(String selector)(Code)
Selects the value of a node, parsing integers and floats.
Parameters:
  selector - the selector/xpath query the node value



selectNumber
native public static float selectNumber(String selector, Element root)(Code)
Selects the value of a node, parsing integers and floats.
Parameters:
  selector - the selector/xpath query
Parameters:
  root - the start of the query (defaults to document) the node value



selectValue
native public static String selectValue(String selector)(Code)
Selects the value of a node.
Parameters:
  selector - the selector/xpath query the node value



selectValue
native public static String selectValue(String selector, Element root)(Code)
Selects the value of a node
Parameters:
  selector - the selector/xpath query
Parameters:
  root - the start of the query (defaults to document) the node value



selectValue
native public static String selectValue(String selector, Element root, String defaultValue)(Code)
Selects the value of a node, optionally replacing null with the defaultValue
Parameters:
  selector - the selector/xpath query
Parameters:
  root - the start of the query (defaults to document)
Parameters:
  defaultValue - value returned if null the node value



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.