Java Doc for ComponentReference.java in  » Testing » abbot-1.0.1 » abbot » script » 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 » Testing » abbot 1.0.1 » abbot.script 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.script.ComponentReference

ComponentReference
public class ComponentReference implements XMLConstants,XMLifiable,Comparable(Code)
Encapsulate as much information as is available to identify a GUI component. Usage:
<component id="..." class="..." [...]>
The component reference ID may be used in scripts in place of the actual component to which this reference refers. The conversion will be made when the actual component is needed. The ID is arbitrary, and may be changed in scripts to any unique string (just remember to change all references to the ID in other places in the script as well).

A number of optional tags are supported to provide an increasingly precise specification of the desired component:

  • weighted refers to the name of an available attribute which should be weighted more heavily in comparisons, e.g. the label on a JButton.
  • parent the reference id of this component's parent.

ComponentReferences may be created in one of three ways, each of which has slightly different implications.

  • Resolver.addComponent(Component) - creates a reference if one doesn't already exist and modifiers the Resolver to include it.
  • getReference(Resolver, Component, Map) - create a reference only if a matching one does not exist, but does not modify the Resolver.
  • ComponentReference - create a new reference.


Field Summary
final static  StringANON_INNER_CLASS
    
final public static  intMW_FAILURE
     Match weight corresponding to no possible match.
final public static  StringSHARED_FRAME_ID
    
static  booleancacheOnCreation
     Disable immediate cacheing of components when a reference is created based on a Component.

Constructor Summary
public  ComponentReference(Resolver resolver, Element el)
     For creation from XML.
public  ComponentReference(Resolver r, Class cls, String[][] attributes)
     Create a reference to an instance of the given class, given an array of name/value pairs of attributes.
public  ComponentReference(Resolver resolver, Class cls, Map attributes)
     Create a reference to an instance of the given class, given a Map of attributes.
public  ComponentReference(Resolver resolver, Component comp)
     Create a reference based on the given component.
public  ComponentReference(Resolver resolver, Component comp, Map newReferences)
     Create a reference based on the given component.

Method Summary
public  intcompareTo(Object o)
    
public  booleanequals(Object obj)
     Two ComponentReferences with identical XML representations should be equal.
 booleanexpressionMatch(String pattern, String actual)
     Return whether the given pattern matches the given string.
public  voidfromXML(String input)
     Set all options based on the given XML.
public  StringgetAttribute(String key)
    
public  MapgetAttributes()
    
 ComponentgetCachedLookup(Hierarchy hierarchy)
     Return the cached component match, if any.
public  ComponentgetComponent()
     Return the component in the current Hierarchy that best matches this reference.
public  ComponentgetComponent(Hierarchy hierarchy)
     Return the component in the given Hierarchy that best matches this reference.
public static  StringgetDescriptiveName(Component c)
     Return a descriptive name for the given component for use in UI text (may be localized if appropriate and need not be re-usable across locales.
public  StringgetDescriptiveName()
     Return a suitably descriptive name for this reference, for use as an ID (returns the ID itself if already set).
public  StringgetID()
    
public  ComponentReferencegetInvokerReference(Map newReferences)
    
 intgetMatchWeight(Component comp)
     Return a measure of how well the given component matches the given component reference.
static  StringgetOrder(Component original, Component[] matchList, boolean horizontal)
     Return the order of the given component among the array given, sorted by horizontal or vertical screen position.
public  ComponentReferencegetParentReference(Map newRefs)
    
public  StringgetRefClassName()
    
public static  ComponentReferencegetReference(Resolver r, Component comp, Map newReferences)
     Returns a reference to the given component, preferring an existing reference if a matching one is available or creating a new one if not.
public  StringgetUniqueID(Map refs)
    
public  ComponentReferencegetWindowReference(Map newReferences)
     Reference ID of this component's parent window (optional).
public  booleanisAssignableFrom(Class cls)
     Return whether this reference has the same class or is a superclass of the given component's class.
public static  ComponentReferencematchExisting(Component comp, Collection existing)
     Match the given component against an existing set of references.
public static  ComponentReferencematchExisting(Component comp, Collection existing, Map newReferences)
     Match the given component against an existing set of references.
public  voidsetAttribute(String key, String value)
    
public  StringtoEditableString()
    
public  StringtoString()
     Return a human-readable representation.
public  ElementtoXML()
     Generate an XML representation of this object.
public  StringtoXMLString()
    

Field Detail
ANON_INNER_CLASS
final static String ANON_INNER_CLASS(Code)



MW_FAILURE
final public static int MW_FAILURE(Code)
Match weight corresponding to no possible match.



SHARED_FRAME_ID
final public static String SHARED_FRAME_ID(Code)



cacheOnCreation
static boolean cacheOnCreation(Code)
Disable immediate cacheing of components when a reference is created based on a Component. Cacheing will first be done when the reference is resolved for the first time after creation. For testing purposes only.




Constructor Detail
ComponentReference
public ComponentReference(Resolver resolver, Element el) throws InvalidScriptException(Code)
For creation from XML.



ComponentReference
public ComponentReference(Resolver r, Class cls, String[][] attributes)(Code)
Create a reference to an instance of the given class, given an array of name/value pairs of attributes.



ComponentReference
public ComponentReference(Resolver resolver, Class cls, Map attributes)(Code)
Create a reference to an instance of the given class, given a Map of attributes.



ComponentReference
public ComponentReference(Resolver resolver, Component comp)(Code)
Create a reference based on the given component. Will not use or create any ancestor components/references.



ComponentReference
public ComponentReference(Resolver resolver, Component comp, Map newReferences)(Code)
Create a reference based on the given component. May recursively create other components required to identify this one.




Method Detail
compareTo
public int compareTo(Object o)(Code)



equals
public boolean equals(Object obj)(Code)
Two ComponentReferences with identical XML representations should be equal.



expressionMatch
boolean expressionMatch(String pattern, String actual)(Code)
Return whether the given pattern matches the given string. Performs variable substitution on the pattern.



fromXML
public void fromXML(String input) throws InvalidScriptException, IOException(Code)
Set all options based on the given XML.



getAttribute
public String getAttribute(String key)(Code)



getAttributes
public Map getAttributes()(Code)



getCachedLookup
Component getCachedLookup(Hierarchy hierarchy)(Code)
Return the cached component match, if any.



getComponent
public Component getComponent() throws ComponentNotFoundException, MultipleComponentsFoundException(Code)
Return the component in the current Hierarchy that best matches this reference.



getComponent
public Component getComponent(Hierarchy hierarchy) throws ComponentNotFoundException, MultipleComponentsFoundException(Code)
Return the component in the given Hierarchy that best matches this reference.



getDescriptiveName
public static String getDescriptiveName(Component c)(Code)
Return a descriptive name for the given component for use in UI text (may be localized if appropriate and need not be re-usable across locales. Robot.getDescriptiveName(Component)



getDescriptiveName
public String getDescriptiveName()(Code)
Return a suitably descriptive name for this reference, for use as an ID (returns the ID itself if already set). Will never return an empty String.



getID
public String getID()(Code)



getInvokerReference
public ComponentReference getInvokerReference(Map newReferences)(Code)



getMatchWeight
int getMatchWeight(Component comp)(Code)
Return a measure of how well the given component matches the given component reference. The weight performs two functions; one is to loosely match so that we can find a component even if some of its attributes have changed. The other is to distinguish between similar components.

In general, we want to match if we get any weight at all, and there's only one component that matches.




getOrder
static String getOrder(Component original, Component[] matchList, boolean horizontal)(Code)
Return the order of the given component among the array given, sorted by horizontal or vertical screen position. All components with the same effective value will have the same order.



getParentReference
public ComponentReference getParentReference(Map newRefs)(Code)



getRefClassName
public String getRefClassName()(Code)



getReference
public static ComponentReference getReference(Resolver r, Component comp, Map newReferences)(Code)
Returns a reference to the given component, preferring an existing reference if a matching one is available or creating a new one if not. The new references are not added to the resolver.



getUniqueID
public String getUniqueID(Map refs)(Code)



getWindowReference
public ComponentReference getWindowReference(Map newReferences)(Code)
Reference ID of this component's parent window (optional).



isAssignableFrom
public boolean isAssignableFrom(Class cls)(Code)
Return whether this reference has the same class or is a superclass of the given component's class. Simply compare class names to avoid class loader conflicts. Note that this does not take into account interfaces (which is okay, since with GUI components we're only concerned with class inheritance).



matchExisting
public static ComponentReference matchExisting(Component comp, Collection existing)(Code)
Match the given component against an existing set of references.



matchExisting
public static ComponentReference matchExisting(Component comp, Collection existing, Map newReferences)(Code)
Match the given component against an existing set of references. Extended method that also takes in a list of new references that might have been created in this cycle



setAttribute
public void setAttribute(String key, String value)(Code)



toEditableString
public String toEditableString()(Code)



toString
public String toString()(Code)
Return a human-readable representation.



toXML
public Element toXML()(Code)
Generate an XML representation of this object.



toXMLString
public String toXMLString()(Code)



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.