public abstract class GuiObjectRecognition
extends java.lang.Object
Type=Window;Caption=Notepad :Window with specified Caption Type=EditBox;Index=2 :2nd EditBox Type=CheckBox;Name=check1 :A Named CheckBox Class=java.awt.Button;ClassIndex=1 :The first java.awt.Button Type=JavaMenu;Index=1;Path=File->Exit :A File Exit menuitem.
Recognition strings are made of of different named "pieces" or components.
In general, a single object's recognition string is comprised of a Category and one or more Qualifiers.
Domain can specify a specific domain (like Domain=Html;) to search and would precede other Category info like Type or Class. Domain would not normally be used with the Process Category as mentioned below.
Process can specify a specific Process (like Process=EXCEL.EXE;) to search and would precede other Category info like Type or Class. This would normally only be used when dealing with native objects in the Win or Net Domains and would not normally be used with the Domain Category mentioned above. The process name specified is currently case-sensitive, so an exact match is attempted when compared.
CurrentWindow is Process, Domain, and Category independent and means "the topmost window"--regardless of what Type or Domain it is.
To identify a particular child object in a hierarchy of objects we provide a recognition string that provides some or all of the object hierarchy information. Each child recognition string is separated from it's parent recognition string with an object separator substring: ";\;"
Example: Type=Window;Caption=MyApp;\;Type=EditBox;Index=1
This matches the first child EditBox (Index=1) in a Window with Caption "MyApp".
Note, however, that an instance of this class only handles the recognition string for a single object in the hierarchy. There will be a separate instance handling each parent and each child of the full path recognition string.
Modifier and Type | Class and Description |
---|---|
protected class |
GuiObjectRecognition.GORInfo
Used internally, or by direct subclasses only.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
_convert_NBSP_Strings
Default true means always convert NBSP characters to normal SPACE characters
during comparisons.
|
protected java.lang.String |
assignSeparator |
static java.lang.String |
CATEGORY_CLASS
"Class"
|
static int |
CATEGORY_CLASS_ID |
static java.lang.String |
CATEGORY_CURRENTWINDOW
"CurrentWindow"
|
static int |
CATEGORY_CURRENTWINDOW_ID |
static java.lang.String |
CATEGORY_DOMAIN
"Domain"
|
static int |
CATEGORY_DOMAIN_ID |
static java.lang.String |
CATEGORY_JAVA_CLASS
"JavaClass"
|
static java.lang.String |
CATEGORY_PROCESS
"Process"
|
static int |
CATEGORY_PROCESS_ID |
static java.lang.String |
CATEGORY_TYPE
"Type"
|
static int |
CATEGORY_TYPE_ID |
static int |
CATEGORY_UNKNOWN_ID |
protected int |
categoryIndex
index to the Category value portion of the recognition string.
|
protected java.lang.String |
classCategory
only the Category class/type portion of the recognition string.
|
protected int |
classCategoryID
The Category ID of the recognition string.
|
protected java.lang.String |
classInfo
only the Category portion of the recognition string.
|
protected java.lang.String |
classValue
only the Category value portion of the recognition string.
|
protected static java.lang.String[] |
containerClassesIgnoredForRecognition
List of container classes we may wish to not only exclude from longer recognition strings but also exclude
from whole component hierarchy.
|
protected static java.lang.String[] |
containerNamesIgnoredForRecognition
List of container names we may wish to exclude from longer recognition strings.
|
protected static java.lang.String[] |
containerTypes
List of items considered to be component containers:
TabControl, JavaPanel, JavaWindow, Window, JavaSplitPane |
protected static java.lang.String[] |
containerTypesIgnoredForRecognition
List of container types we may wish to exclude from longer recognition strings.
|
protected static java.lang.String[] |
containerTypesWithOnlyOneChildVisible
List of containers whose non-visible children we may sometimes wish to process.
|
static java.lang.String |
DEFAULT_ASSIGN_SEPARATOR
"="
|
static java.lang.String |
DEFAULT_CLOSE_CAPTION_EXPRESSION
"}" End wildcard definition
|
static java.lang.String |
DEFAULT_MATCH_ANY |
static java.lang.String |
DEFAULT_OPEN_CAPTION_EXPRESSION
"{" Begin wildcard definition
|
static java.lang.String |
DEFAULT_PATH_SEPARATOR
"->"
|
static java.lang.String |
DEFAULT_PROPERTY_QUALIFIER_SEPARATOR
":"
|
static java.lang.String |
DEFAULT_QUALIFIER_SEPARATOR
";"
|
static java.lang.String[] |
DhtmlElements |
protected java.lang.String |
domainInfo
only the Domain portion of the recognition string, if present.
|
protected java.lang.String |
domainValue
only the Domain value portion of the recognition string, if present.
|
protected GuiObjectRecognition.GORInfo[] |
gorInfos
There can be multiple qualifiers.
|
protected int |
govLevel
the hierarchy level within the GuiObjectVector path represented by this recognition substring.
|
static java.lang.String[] |
htmlElements |
protected static java.lang.String[] |
ignoreTypeChildren
List of components from which we should not getChildren() as we go through the hierarchy.
|
static java.lang.String[] |
linkHtmlElements |
static java.lang.String |
NBSP_STRING
"xA0" or #160 -- non-breaking space in Html
|
protected java.lang.String |
pathInfo
the full recognition string provided to constructor
Ex: "Type=Window;Caption=MyApp"
|
protected java.lang.String |
processInfo
only the Process portion of the recognition string, if present.
|
protected java.lang.String |
processValue
only the Process value portion of the recognition string, if present.
|
static java.lang.String |
QUALIFIER_ABS_INDEX
"AbsIndex"
|
static int |
QUALIFIER_ABS_INDEX_ID |
static java.lang.String |
QUALIFIER_CAPTION
"Caption"
|
static int |
QUALIFIER_CAPTION_ID |
static java.lang.String |
QUALIFIER_CLASS
"Class"
|
static java.lang.String |
QUALIFIER_CLASS_CONTAINS
"ClassContains"
|
static int |
QUALIFIER_CLASS_ID |
static java.lang.String |
QUALIFIER_CLASS_INDEX
"ClassIndex"
|
static int |
QUALIFIER_CLASS_INDEX_ID |
static java.lang.String |
QUALIFIER_HTMLID
"HTMLID"
|
static int |
QUALIFIER_HTMLID_ID |
static java.lang.String |
QUALIFIER_HTMLTEXT
"HTMLText"
|
static int |
QUALIFIER_HTMLTEXT_ID |
static java.lang.String |
QUALIFIER_HTMLTITLE
"HTMLTitle"
|
static int |
QUALIFIER_HTMLTITLE_ID |
static java.lang.String |
QUALIFIER_ID
"ID"
|
static int |
QUALIFIER_ID_ID |
static java.lang.String |
QUALIFIER_INDEX
"Index"
|
static int |
QUALIFIER_INDEX_ID |
static java.lang.String |
QUALIFIER_JAVA_CLASS
"JavaClass"
|
static java.lang.String |
QUALIFIER_JAVACAPTION
"JavaCaption"
|
static int |
QUALIFIER_JAVACAPTION_ID |
static java.lang.String |
QUALIFIER_LEVEL
"Level"
|
static int |
QUALIFIER_LEVEL_ID |
static java.lang.String |
QUALIFIER_NAME
"Name"
|
static java.lang.String |
QUALIFIER_NAME_CONTAINS
"NameContains"
|
static int |
QUALIFIER_NAME_CONTAINS_ID |
static int |
QUALIFIER_NAME_ID |
static java.lang.String |
QUALIFIER_OBJECT_INDEX
"ObjectIndex"
|
static int |
QUALIFIER_OBJECT_INDEX_ID |
static java.lang.String |
QUALIFIER_PATH
"Path"
|
static int |
QUALIFIER_PATH_ID |
static java.lang.String |
QUALIFIER_PROPERTY
"Property"
|
static java.lang.String |
QUALIFIER_PROPERTY_CONTAINS
"PropertyContains"
|
static int |
QUALIFIER_PROPERTY_CONTAINS_ID |
static int |
QUALIFIER_PROPERTY_ID |
static java.lang.String |
QUALIFIER_TEXT
"Text"
|
static int |
QUALIFIER_TEXT_ID |
static int |
QUALIFIER_UNKNOWN_ID |
protected java.lang.String |
qualifierInfo
only the Qualifier portion of the recognition string.
|
protected int |
qualifierMatches
Tracks multiple qualifier matches.
|
protected java.lang.String |
qualifierSeparator |
protected static java.lang.String[] |
textOKForRecognition
List of component types we may wish to getText on for recognition purposes.
|
protected static java.lang.String[] |
topLevelContainers
List of known container types that should have IndexMaps prepared for their children.
|
Constructor and Description |
---|
GuiObjectRecognition(java.lang.String objectInfo,
int govLevel)
Used internally, or by direct subclasses only.
Standard Constructor using default qualifier separator. |
GuiObjectRecognition(java.lang.String objectInfo,
java.lang.String aQualifierSeparator,
int govLevel)
Used internally, or by direct subclasses only.
Constructor using a different qualifier separator from our standard. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
compareText(java.lang.String theText,
java.lang.String objText)
Used to compare 2 text values.
|
protected void |
extractClassInfo()
Used internally, or by direct subclasses only.
Internal helper routine to fill internal fields. Separates the Category into classCategory and classValue fields. Ex: "Type=Window" gets separated into: |
java.lang.String |
getClassCategory()
Used internally, or by direct subclasses only.
|
int |
getClassCategoryID()
Used internally, or by direct subclasses only.
|
java.lang.String |
getClassRecognition()
Used internally, or by direct subclasses only.
|
java.lang.String |
getClassValue()
Used internally, or by direct subclasses only.
|
java.lang.String |
getDomainValue()
Normally only valid for the topmost Parent GOR object.
|
int |
getGovLevel()
Returns the govLevel assigned in the constructor.
|
java.lang.Object |
getMatchingObject(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Called from ChildIterator. |
abstract java.lang.Object |
getMatchingPathObject(java.lang.Object theObject,
java.lang.String thePath)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
java.lang.String |
getObjectAccessibleName(java.lang.Object theObject)
Allow individual engines (ie.
|
abstract java.lang.String |
getObjectCaption(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
java.lang.String |
getObjectClassIndex(java.lang.Object item)
Used internally, or by direct subclasses only.
Subclasses are generally expected to implement a means to determine the Nth occurrence of the specific object class in the application's child object hierarchy. |
abstract java.lang.String |
getObjectClassName(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
abstract java.lang.String |
getObjectDomain(java.lang.Object theObject)
Used internally or by subclasses only.
|
abstract java.lang.String |
getObjectID(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
abstract int |
getObjectLevel(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Level is generally considered to be the Z-Order information of the object--where in the Z-Order the object (usually a window) resides. |
abstract java.lang.String |
getObjectName(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
abstract java.lang.String |
getObjectProperty(java.lang.Object theObject,
java.lang.String theProperty)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
abstract java.lang.String[] |
getObjectPropertyNames(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
java.lang.String |
getObjectRecognition()
Used internally, or by direct subclasses only.
|
java.lang.String[] |
getObjectSuperClassNames(java.lang.Object theObject)
Used internally, or by direct subclasses.
Subclasses using proxies must override with a tool-dependent mechanism to provide the requested information. |
abstract java.lang.String |
getObjectText(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
java.lang.String |
getProcessValue()
Normally only valid for the topmost Parent GOR object.
|
java.lang.String |
getQualifierCategory(int index)
Used internally, or by direct subclasses only.
|
int |
getQualifierCategoryID(int index)
Used internally, or by direct subclasses only.
|
int |
getQualifierCount()
Used internally, or by direct subclasses only.
|
java.lang.String |
getQualifierIDValue(int qualifierID)
Used internally, or by direct subclasses only.
Extracts the Value of the qualifier with the matching qualifier type ID. |
java.lang.String |
getQualifierRecognition()
Used internally, or by direct subclasses only.
|
java.lang.String |
getQualifierSeparator()
Used internally, or by direct subclasses only.
|
java.lang.String |
getQualifierValue(int index)
Used internally, or by direct subclasses only.
|
protected boolean |
hasCategoryInfo()
Used internally, or by direct subclasses only.
|
protected boolean |
hasDomainInfo()
Used internally, or by direct subclasses only.
Sets the domainInfo, domainValue if Domain is present. |
protected boolean |
hasProcessInfo()
Used internally, or by direct subclasses only.
Sets the processInfo, processValue if Process is present. |
void |
initDomainInfo()
Initialize to isolate any Domain= or Process= information in the
recognition string.
|
static boolean |
isContainerClassIgnoredForRecognition(java.lang.String compClass)
Called by PCTree#ignoreParentRecognitionString(PCTree)
|
static boolean |
isContainerNameIgnoredForRecognition(java.lang.String compName) |
static boolean |
isContainerType(java.lang.String compType) |
static boolean |
isContainerTypeIgnoredForRecognition(java.lang.String compType) |
static boolean |
isContainerTypeWithOnlyOneChildVisible(java.lang.String compType) |
static boolean |
isDHtmlElement(java.lang.String element) |
boolean |
isFinalMatch(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Perform whatever tests we want on the found Object to decide if this is our desired final match. |
static boolean |
isHtmlElement(java.lang.String element) |
static boolean |
isIgnoredTypeChild(java.lang.String compType) |
static boolean |
isLinkHtmlElement(java.lang.String element) |
boolean |
isMatchingCaption(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Convenience routine to check if the object matches the Caption information stored in this GuiObjectRecognition instance *without* specifying what the is as required by the primary, tool-dependent isMatchingCaption routine. Simply calls the subclass isMatchingCaption routine with null as the caption parameter. |
boolean |
isMatchingCaption(java.lang.Object theObject,
java.lang.String theCaption)
Used internally, or by direct subclasses only.
Calls the subclass's getObjectCaption function. |
boolean |
isMatchingClass(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Convenience routine to check if the object matches the Class or Type information stored in this GuiObjectRecognition instance *without* specifying what the classname or type is as required by the primary, tool-dependent isMatchingClass routine. Simply calls the subclass isMatchingClass routine with null as the classname parameter. |
boolean |
isMatchingClass(java.lang.Object theObject,
java.lang.String theClass)
Used internally, or by direct subclasses only.
Determine if the provided Object matches our segment of the recognition string. |
boolean |
isMatchingID(java.lang.Object theObject,
java.lang.String theID)
Used internally, or by direct subclasses only.
Calls the subclass's getObjectID function. |
boolean |
isMatchingLevel(java.lang.Object theObject,
int theLevel)
Used internally, or by direct subclasses only.
Calls the subclass's getObjectLevel function. |
boolean |
isMatchingName(java.lang.Object theObject,
java.lang.String theName,
boolean blnExact)
Used internally, or by direct subclasses only.
Calls the subclass's getObjectName function. |
boolean |
isMatchingObject(java.lang.Object theObject,
int classindex,
int absindex,
java.lang.String[] matchName)
Used internally, or by direct subclasses only.
First checks to see if the provided object matches class information for our stored recognition method. |
abstract boolean |
isMatchingPath(java.lang.Object theObject,
java.lang.String thePath)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
boolean |
isMatchingProperty(java.lang.Object theObject,
java.lang.String qualifierValue,
boolean blnExact)
Used internally, or by direct subclasses only.
calls the subclass's getObjectProperty function with correct information (string parse occurs before call) |
protected boolean |
isMatchingQualifiers(java.lang.Object theObject,
int classindex,
int absindex)
Used internally, called by isMatchingObject.
Attempts to verify that every gorInfo qualifier from the recogntion string stored herein is satisfied by theObject. |
abstract boolean |
isMatchingSubClass(java.lang.Object theObject,
java.lang.String theClass,
java.lang.String parentClass)
Used internally, or by direct subclasses only.
Subclasses are generally expected to simply forward this request on to the tool-dependent GuiClassData.isMatched (like RGuiClassData) function after casting the object to the appropriate class for the tool implementation. |
boolean |
isMatchingText(java.lang.Object theObject,
java.lang.String theText)
Used internally, or by direct subclasses only.
Calls the subclass's getObjectText function. |
abstract boolean |
isMatchingType(java.lang.Object theObject,
java.lang.String theClass)
Used internally, or by direct subclasses only.
Subclasses are generally expected to simply forward this request on to the tool-dependent GuiClassData.getMappedClassType (like RGuiClassData) function after casting the object to the appropriate class for the tool implementation. |
abstract boolean |
isObjectShowing(java.lang.Object theObject)
Used internally, or by direct subclasses only.
Subclasses implement tool-dependent mechanism to provide the requested information. |
static boolean |
isTextOKForRecognition(java.lang.String compType) |
static boolean |
isTopLevelContainer(java.lang.String compType) |
java.lang.String |
makeRegexReadyWildcards(java.lang.String expression)
Convenience routine to convert our single Caption char ? and * wildcard characters
to regex equivalent wildcards.
|
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_QUALIFIER_SEPARATOR
public static final java.lang.String DEFAULT_ASSIGN_SEPARATOR
public static final java.lang.String DEFAULT_PROPERTY_QUALIFIER_SEPARATOR
public static final java.lang.String DEFAULT_PATH_SEPARATOR
public static final java.lang.String CATEGORY_PROCESS
public static final java.lang.String CATEGORY_DOMAIN
public static final java.lang.String CATEGORY_CLASS
public static final java.lang.String CATEGORY_JAVA_CLASS
public static final java.lang.String CATEGORY_TYPE
public static final java.lang.String CATEGORY_CURRENTWINDOW
public static final int CATEGORY_UNKNOWN_ID
public static final int CATEGORY_CLASS_ID
public static final int CATEGORY_TYPE_ID
public static final int CATEGORY_CURRENTWINDOW_ID
public static final int CATEGORY_DOMAIN_ID
public static final int CATEGORY_PROCESS_ID
public static final java.lang.String QUALIFIER_INDEX
public static final java.lang.String QUALIFIER_OBJECT_INDEX
public static final java.lang.String QUALIFIER_CLASS_CONTAINS
public static final java.lang.String QUALIFIER_CLASS_INDEX
public static final java.lang.String QUALIFIER_ABS_INDEX
public static final java.lang.String QUALIFIER_CLASS
public static final java.lang.String QUALIFIER_JAVA_CLASS
public static final java.lang.String QUALIFIER_CAPTION
public static final java.lang.String QUALIFIER_JAVACAPTION
public static final java.lang.String QUALIFIER_PROPERTY
public static final java.lang.String QUALIFIER_PROPERTY_CONTAINS
public static final java.lang.String QUALIFIER_LEVEL
public static final java.lang.String QUALIFIER_PATH
public static final java.lang.String QUALIFIER_NAME
public static final java.lang.String QUALIFIER_NAME_CONTAINS
public static final java.lang.String QUALIFIER_TEXT
public static final java.lang.String QUALIFIER_ID
public static final java.lang.String QUALIFIER_HTMLID
public static final java.lang.String QUALIFIER_HTMLTEXT
public static final java.lang.String QUALIFIER_HTMLTITLE
public static final int QUALIFIER_UNKNOWN_ID
public static final int QUALIFIER_CLASS_ID
public static final int QUALIFIER_OBJECT_INDEX_ID
public static final int QUALIFIER_ABS_INDEX_ID
public static final int QUALIFIER_INDEX_ID
public static final int QUALIFIER_CLASS_INDEX_ID
public static final int QUALIFIER_CAPTION_ID
public static final int QUALIFIER_JAVACAPTION_ID
public static final int QUALIFIER_PROPERTY_ID
public static final int QUALIFIER_PROPERTY_CONTAINS_ID
public static final int QUALIFIER_LEVEL_ID
public static final int QUALIFIER_NAME_ID
public static final int QUALIFIER_NAME_CONTAINS_ID
public static final int QUALIFIER_TEXT_ID
public static final int QUALIFIER_ID_ID
public static final int QUALIFIER_PATH_ID
public static final int QUALIFIER_HTMLTEXT_ID
public static final int QUALIFIER_HTMLTITLE_ID
public static final int QUALIFIER_HTMLID_ID
public static final java.lang.String DEFAULT_OPEN_CAPTION_EXPRESSION
public static final java.lang.String DEFAULT_CLOSE_CAPTION_EXPRESSION
public static final java.lang.String DEFAULT_MATCH_ANY
public static final java.lang.String NBSP_STRING
public static boolean _convert_NBSP_Strings
protected java.lang.String qualifierSeparator
protected java.lang.String assignSeparator
protected int govLevel
protected java.lang.String pathInfo
protected java.lang.String domainInfo
protected java.lang.String domainValue
protected java.lang.String processInfo
protected java.lang.String processValue
protected java.lang.String classInfo
protected java.lang.String classCategory
protected int classCategoryID
protected int categoryIndex
protected java.lang.String classValue
protected java.lang.String qualifierInfo
protected GuiObjectRecognition.GORInfo[] gorInfos
protected int qualifierMatches
public static final java.lang.String[] htmlElements
public static final java.lang.String[] linkHtmlElements
public static final java.lang.String[] DhtmlElements
protected static final java.lang.String[] containerTypes
protected static final java.lang.String[] containerTypesWithOnlyOneChildVisible
Some containers, like TabControls, might have multiple children, but only one is visible at any given time. For example, only one TabPane is selected and visible in a TabControl at any given time. This is a list of such known container types.
#setupIndexMap
protected static final java.lang.String[] topLevelContainers
protected static final java.lang.String[] ignoreTypeChildren
protected static final java.lang.String[] containerTypesIgnoredForRecognition
protected static final java.lang.String[] containerClassesIgnoredForRecognition
protected static final java.lang.String[] containerNamesIgnoredForRecognition
protected static final java.lang.String[] textOKForRecognition
public GuiObjectRecognition(java.lang.String objectInfo, int govLevel)
objectInfo
- the recognition string representing one of the parent
or child objects in the full hierarchy being searched.public GuiObjectRecognition(java.lang.String objectInfo, java.lang.String aQualifierSeparator, int govLevel)
objectInfo
- the recognition string representing one of the parent
or child objects in the full hierarchy being searched.
aQualifierSeparator
- an alternate qualifier separator used in this
recognition string. If null, then the default separator will be used.public java.lang.String getDomainValue()
public java.lang.String getProcessValue()
public static boolean isHtmlElement(java.lang.String element)
public static boolean isLinkHtmlElement(java.lang.String element)
public static boolean isDHtmlElement(java.lang.String element)
public static boolean isContainerType(java.lang.String compType)
compType
- public static boolean isContainerTypeWithOnlyOneChildVisible(java.lang.String compType)
compType
- public static boolean isTopLevelContainer(java.lang.String compType)
compType
- public static boolean isIgnoredTypeChild(java.lang.String compType)
compType
- public static boolean isContainerTypeIgnoredForRecognition(java.lang.String compType)
compType
- public static boolean isContainerClassIgnoredForRecognition(java.lang.String compClass)
compClass
- public static boolean isContainerNameIgnoredForRecognition(java.lang.String compName)
compName
- public static boolean isTextOKForRecognition(java.lang.String compType)
compType
- public int getGovLevel()
public java.lang.String getObjectRecognition()
public java.lang.String getQualifierSeparator()
public void initDomainInfo()
protected boolean hasDomainInfo()
protected boolean hasProcessInfo()
protected boolean hasCategoryInfo()
public java.lang.String getClassRecognition()
protected void extractClassInfo()
classCategory = "Type"
classValue = "Window"
public java.lang.String getClassCategory()
public int getClassCategoryID()
public java.lang.String getClassValue()
public java.lang.String getQualifierRecognition()
public int getQualifierCount()
public java.lang.String getQualifierCategory(int index)
index
- the 0-based index of the gorInfo qualifier to interrogate.public int getQualifierCategoryID(int index)
index
- the 0-based index of the gorInfo qualifier to interrogate.public java.lang.String getQualifierValue(int index)
index
- the 0-based index of the gorInfo qualifier to interrogate.public java.lang.String makeRegexReadyWildcards(java.lang.String expression)
expression
- Generally a qualifierValue holding Caption information.public boolean isMatchingClass(java.lang.Object theObject)
theObject
- to evaluate against our stored recognition information.public java.lang.String[] getObjectSuperClassNames(java.lang.Object theObject)
theObject--sometimes
- a tool-dependent proxy for the object to be evaluated.public boolean isMatchingCaption(java.lang.Object theObject)
theObject
- to evaluate against our stored recognition information.public java.lang.String getQualifierIDValue(int qualifierID)
qualifierID
- constant for the type of qualifier from which we want the value.public boolean isMatchingObject(java.lang.Object theObject, int classindex, int absindex, java.lang.String[] matchName) throws SAFSObjectRecognitionException
theObject
- to evaluate against our stored recognition information.classindex
- to use when comparing Index= class qualifiers. This will either be
the index of the Class instance encountered (ex: javax.swing.JPanel), or the
index of the Class Type encountered (ex: JavaPanel). The correct index type
will have been determined and forwarded by the calling routine (usually a
GuiChildIterator).matchName,
- String [] , if not null, then return in matchName[0] the matching name,
but only when the name is used to match with.SAFSObjectRecognitionException
- passed along from called routines like
isMatchingQualifiers.public java.lang.Object getMatchingObject(java.lang.Object theObject)
theObject
- to evaluate with stored recognition information checking for the need
to locate a different (sub)item.protected boolean isMatchingQualifiers(java.lang.Object theObject, int classindex, int absindex) throws SAFSObjectRecognitionException
theObject
- to evaluate against our stored recognition information.classindex
- to use when comparing Index= class qualifiers. This will either be
the index of the Class instance encountered (ex: javax.swing.JPanel), or the
index of the Class Type encountered (ex: JavaPanel). The correct index type
will have been determined and forwarded by the calling routine (usually a
GuiChildIterator).SAFSObjectRecognitionException
- when encountering unknown or unsupported
categories or qualifiers.public boolean isMatchingClass(java.lang.Object theObject, java.lang.String theClass)
If our recognition string contains a Class definition Class=classname then the routine will try a case-sensitive match of the provided classname. If that doesn't match, the routine will try to see if the actual class is a subclass of the class specified in the recognition string.
If our recognition string contains a Type definition Type=typename
then the routine will call isMatchingType(Object, String)
to attempt the match.
Object
- proxy of the actual object to be compared against our
recognition string.public boolean isMatchingCaption(java.lang.Object theObject, java.lang.String theCaption)
theObject
- to evaluatetheCaption
- to match. If null, we will attempt to retrieve the stored recognition
information in qualifiers for CAPTION or JAVACAPTION.protected boolean compareText(java.lang.String theText, java.lang.String objText)
The routine currently handles:
-- text benchmarks that might have originally been captured and truncated by Rational Robot
-- text that might contain mnemonic or hotkey ampersands (&)
-- text that might contain non-breaking spaces that can be ignored
-- retrieved object text needing trim()med whitespace
theText
- - non-null text to matchobjText
- - non-null retrieved text to compare_convert_NBSP_Strings
public boolean isMatchingProperty(java.lang.Object theObject, java.lang.String qualifierValue, boolean blnExact)
theObject
- to evaluatequalifierValue
- used to determine property test/valueblnExact
- true will run exact match; false will wildcard: *theValue*public boolean isMatchingName(java.lang.Object theObject, java.lang.String theName, boolean blnExact)
theObject
- to evaluatetheName
- to matchblnExact
- true will run exact match; false will wildcard: *theName*public boolean isMatchingLevel(java.lang.Object theObject, int theLevel)
theObject
- to evaluatetheLevel
- to matchpublic boolean isMatchingText(java.lang.Object theObject, java.lang.String theText)
theObject
- to evaluatetheText
- to matchcompareText(String, String)
public boolean isMatchingID(java.lang.Object theObject, java.lang.String theID)
theObject
- to evaluatetheID
- to matchpublic boolean isFinalMatch(java.lang.Object theObject)
Currently, we test that the object isShowing if the object is found by Index. This is done via a call to the subclass's isObjectShowing function. This check is required because different object in hidden panels can have the same Index as those that are showing.
We will have to resolve cases where there are multiple potential matches and none of them are showing. Especially when doing things like interrogating the property values of temporarily hidden (not showing) components.
theObject
- -- the Object to evaluate for a final match.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getObjectAccessibleName(java.lang.Object theObject)
theObject
- public abstract java.lang.String getObjectName(java.lang.Object theObject)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract java.lang.String getObjectClassName(java.lang.Object theObject)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract java.lang.String getObjectCaption(java.lang.Object theObject)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract java.lang.String getObjectDomain(java.lang.Object theObject)
theObject
- -- usually a tool-dependent proxy for the object to be evaluated.public abstract int getObjectLevel(java.lang.Object theObject)
Subclasses implement tool-dependent mechanism to provide the requested information. The information is used to determine if a particular object is a match for our stored recognition information.
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract java.lang.String getObjectText(java.lang.Object theObject)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract java.lang.String getObjectID(java.lang.Object theObject)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract java.lang.String[] getObjectPropertyNames(java.lang.Object theObject)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract java.lang.String getObjectProperty(java.lang.Object theObject, java.lang.String theProperty)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.theProperty
- name of the property value to be evaluated in the object.
Property names are assumed to be case-sensitive.public abstract java.lang.Object getMatchingPathObject(java.lang.Object theObject, java.lang.String thePath)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.thePath
- information to locate another object or subitem relative to theObject.
this is usually something like a menuitem or tree node where supported.public abstract boolean isMatchingPath(java.lang.Object theObject, java.lang.String thePath)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.thePath
- information to locate another object or subitem relative to theObject.
this is usually something like a menuitem or tree node where supported.public abstract boolean isObjectShowing(java.lang.Object theObject)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.public abstract boolean isMatchingType(java.lang.Object theObject, java.lang.String theClass)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.theClass
- information extracted here and forwarded for GuiClassData.isMappedClassType.public abstract boolean isMatchingSubClass(java.lang.Object theObject, java.lang.String theClass, java.lang.String parentClass)
theObject--usually
- a tool-dependent proxy for the object to be evaluated.theClass
- information extracted here and forwarded for GuiClassData.isMatched.parentClass
- information extracted here and forwarded for GuiClassData.isMatched.public java.lang.String getObjectClassIndex(java.lang.Object item)
Example use: Give us the Class Index that would work for a Class category recognition string like:
Child="Class=com.custom.class.MyTreeClass;Index=N", or
Child="Class=com.custom.class.MyTreeClass;ClassIndex=N"
theObject--usually
- a tool-dependent proxy for the object to be evaluated.Copyright © SAS Institute. All Rights Reserved.