public abstract class GuiObjectVector
extends java.lang.Object
Copyright (C) (SAS) All rights reserved.
General Public License: http://www.opensource.org/licenses/gpl-license.php
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTIVE_WINDOW_REFERENCE
".\;" -- Reference to the current active window.
|
protected java.util.Hashtable |
cache |
protected java.lang.String |
childName
Stores the name of the child component involved in our search.
|
protected java.lang.String |
childSeparator
Stores the defined parent/child separator.
|
static java.lang.String |
DEFAULT_CHILD_SEPARATOR
";\;" -- separates parent/child relationships in recognition strings.
|
static java.lang.String |
DESKTOP_REFERENCE
"\;" -- Reference to the Desktop.
|
static java.lang.String |
DOTNET_POPUPMENU |
static java.lang.String |
FULLPATH_SEARCH_MODE_PREFIX
":FPSM:"
case-insensitive prefix on entry path vector indicating recognition string is a
fullpath search mode recognition string.
|
static java.lang.String |
GENERIC_OBJECTTYPE_POPUPWINDOW
"POPUPWINDOW" -- The upper-case generic "sought" object type for top level popup menu window.
|
static int |
INITIAL_CACHE_SIZE |
protected boolean |
isFullPathSearchString
True for FullPath Search Mode.
|
protected boolean |
isMappedClassSearchString
True for MappedClass Search Mode.
|
protected boolean |
isRftFindSearchString
True for RFT Find Search Mode.
|
static java.lang.String |
MAPPEDCLASS_SEARCH_MODE_PREFIX
":MCSM:"
case-insensitive prefix on entry path vector indicating recognition string is a
mapped class search mode recognition string.
|
static int |
MODE_ENGINE_PROCESSING |
static int |
MODE_EXTERNAL_PROCESSING |
static java.lang.String |
OBJECTTYPE_POPUPCONTAINER
"JavaPopupContainer" -- A JFrame can contain an active JavaPopupMenu.
|
static java.lang.String |
OBJECTTYPE_POPUPMENU
"JavaPopupMenu" -- The "sought" object type for java popup menus.
|
static java.lang.String |
OBJECTTYPE_POPUPWINDOW
"JavaPopupWindow" -- The "sought" object type for top level popup menu window.
|
protected java.util.Vector |
path
Holds full hierarchy of GuiObjectRecognition objects.
|
protected java.lang.String |
pathVector
Stores the full recognition string provided to the constructor.
|
protected int |
process_mode |
static java.lang.String |
PROPERTYALL_SEARCH_MODE_PREFIX
":PASM:"
With this prefix, for RS like "prop1=xxx;prop2=xxx;prop3=xxx", "prop1", "prop2" and "prop3" will
all be considered as properties; Without this prefix, they will be considered as SAFS qualifier.
|
protected boolean |
propertyAllSearchMode
True for Property All Search Mode.
|
static java.lang.String[] |
recognitionStringPrefixes
List of all R-String prefixes supported by SAFS
|
static java.lang.String |
RFT_FIND_SEARCH_MODE_PREFIX
":RFSM:"
case-insensitive prefix on entry path vector indicating recognition string is a
RFT find search mode recognition string.
|
static java.lang.String |
SIMPLETYPE_POPUPMENU
"POPUPMENU" -- The upper-case "simple" object type for popup menus.
|
static java.lang.String |
WIN_POPUPMENU |
protected java.lang.String |
windowName
Stores the name of the window component involved in our search.
|
Constructor and Description |
---|
GuiObjectVector()
Alternate minimal constructor.
|
GuiObjectVector(java.lang.String window,
java.lang.String child,
java.lang.String pathString)
Primary constructor for the superclass.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object[] |
convertToKeys(java.lang.Object[] items)
Convert an array of engine-specific objects to an array of unique keys
in the cache.
|
protected abstract GuiChildIterator |
createGuiChildIterator(java.util.List gather)
Return a GuiChildIterator subclass instance.
|
protected abstract GuiChildIterator |
createGuiChildIterator(java.lang.Object aparent,
GuiObjectVector govVector,
java.util.List gather)
Return a GuiChildIterator subclass instance.
|
protected abstract GuiObjectRecognition |
createGuiObjectRecognition(java.lang.String subpath,
int govLevel)
Return a GuiObjectRecognition subclass instance.
|
protected java.lang.Object |
getCachedItem(java.lang.Object key)
Attempts to retrieve an item from cache using the provided key.
|
GuiObjectRecognition |
getChildGuiObjectRecognition(int index)
Returns the indexed GuiObjectRecognition stored.
|
java.util.Vector |
getChildMatchData(java.lang.Object _aparent,
java.util.List gather)
Purpose: get ALL child MatchData This is primarily intended to be used by Component Functions or other entities that need to get ALL possible components or objects of a particular recognition string. |
java.lang.String |
getChildName()
Stores the constructors child string.
|
abstract java.lang.Object[] |
getChildObjects(java.lang.Object parent)
Return an array representing all known child objects of the parent.
|
abstract java.lang.Object[] |
getDomainParentObjects(java.lang.String domainname)
Return an array representing all known parent windows from one single domain.
|
GuiObjectRecognition |
getFinalChildGuiObjectRecognition()
Returns the last GuiObjectRecognition stored--the one for final match.
|
protected abstract GuiClassData |
getGuiClassData()
Return the subclass of GuiClassData used by your tool.
|
protected java.lang.String |
getGuiObjectType(java.lang.Object _parent) |
java.lang.Object |
getMatchingChildObject(java.lang.Object _aparent,
java.util.List gather)
get child test object
|
java.lang.Object |
getMatchingParentObject()
Searches the test domains one-by-one in the order received from Domains.getEnabledDomains().
|
GuiObjectRecognition |
getParentGuiObjectRecognition()
Returns the topmost parent GuiObjectRecognition.
|
abstract java.lang.Object[] |
getParentObjects()
Return an array representing all known parent windows.
|
java.lang.String |
getPathVector() |
int |
getProcessMode()
Return the current setting for processing mode.
|
int |
getRecognitionDepth()
Returns the hierarchy depth of the pathString when available.
|
java.lang.String |
getVectorString()
Stores the constructors pathString.
|
java.lang.String |
getWindowName()
Stores the constructors window string.
|
void |
initGuiObjectRecognition()
Initialize path vector storage with GuiObjectRecognition objects.
|
boolean |
isFullPathSearchMode() |
boolean |
isMappedClassSearchMode() |
boolean |
isMatchingParent(java.lang.Object _parent) |
static boolean |
isMode(java.util.List<java.lang.String> prefixList,
java.lang.String mode) |
static boolean |
isPASMMode(java.util.List<java.lang.String> prefixList) |
boolean |
isPropertyAllSearchMode() |
boolean |
isRftFindSearchMode() |
protected boolean |
isSeekingPopupMenu()
Only reference recognition string and no specific object.
|
protected boolean |
isTopLevelPopupContainer(java.lang.Object _parent) |
protected boolean |
isTopLevelPopupWindow(java.lang.Object _parent) |
protected abstract boolean |
isValidGuiContainer(java.lang.Object object)
Return true if the provided object represents a gui container.
|
abstract boolean |
isValidGuiObject(java.lang.Object object)
Return true if the provided object represents a valid gui component.
|
protected java.util.Vector |
iterateChildMatchData(java.lang.Object _aparent,
java.util.List gather) |
protected java.lang.Object |
iterateChildren(java.lang.Object _aparent,
java.util.List gather)
used by getMatchingChildObject below.
|
protected java.lang.String |
makeUniqueCacheKey(java.lang.Object item)
Routine is used to create a unique ID String key that can be used by external
processes like Process Container to identify an engine-specific item in the
cache.
|
protected void |
putCachedItem(java.lang.Object key,
java.lang.Object item)
Attempts to put an item in cache using the provided key.
|
protected java.lang.Object |
removeCachedItem(java.lang.Object key)
Remove an item from cache.
|
static java.lang.String |
removeRStringPrefixes(java.lang.String pathVector,
java.util.List<java.lang.String> list)
Remove prefixes known by SAFS from a recognition string, return the left part and a list of prefixes removed.
|
void |
resetExternalModeCache()
Clear and\or reset the internal component cache used in non-typical modes
of operation like MODE_EXTERNAL_PROCESSING (Process Container).
|
abstract void |
setActiveWindow(java.lang.Object _comp)
Make the Window referenced by _comp the active window.
|
void |
setChildName(java.lang.String childName)
This must be provided to a Constructor or otherwise be set prior to using
an instance of this class.
|
void |
setFullPathSearchMode(boolean fullpathmode)
Set to true to specify recognition string is a full path search mode recognition string.
|
void |
setMappedClassSearchMode(boolean mappedclassmode)
Set to true to specify recognition string is a mapped class search mode recognition string.
|
void |
setPathVector(java.lang.String pathVector)
This must be provided to a Constructor or otherwise be set prior to using
an instance of this class.
|
void |
setProcessMode(int mode)
As of initial writing, there are two modes in which Gui object usage
may differ inside a running engine:
MODE_ENGINE_PROCESSING MODE_EXTERNAL_PROCESSING |
void |
setPropertyAllSearchMode(boolean propertyAllSearchMode)
Set to true to specify recognition string is a 'Property All' search mode recognition string.
|
void |
setRftFindSearchMode(boolean rftFindSearchMode)
Set to true to specify recognition string is a RFT find search mode recognition string.
|
void |
setWindowName(java.lang.String windowName)
This must be provided to a Constructor or otherwise be set prior to using
an instance of this class.
|
public static final java.lang.String DEFAULT_CHILD_SEPARATOR
public static final java.lang.String DESKTOP_REFERENCE
public static final java.lang.String ACTIVE_WINDOW_REFERENCE
public static final java.lang.String OBJECTTYPE_POPUPWINDOW
public static final java.lang.String GENERIC_OBJECTTYPE_POPUPWINDOW
public static final java.lang.String OBJECTTYPE_POPUPCONTAINER
public static final java.lang.String OBJECTTYPE_POPUPMENU
public static final java.lang.String DOTNET_POPUPMENU
public static final java.lang.String WIN_POPUPMENU
public static final java.lang.String SIMPLETYPE_POPUPMENU
public static final int MODE_ENGINE_PROCESSING
public static final int MODE_EXTERNAL_PROCESSING
public static final int INITIAL_CACHE_SIZE
public static final java.lang.String FULLPATH_SEARCH_MODE_PREFIX
":FPSM:" case-insensitive prefix on entry path vector indicating recognition string is a fullpath search mode recognition string.
public static final java.lang.String MAPPEDCLASS_SEARCH_MODE_PREFIX
":MCSM:" case-insensitive prefix on entry path vector indicating recognition string is a mapped class search mode recognition string. In mapped-class-search-mode, only mapped classes shall be considered; those who do not hold interesting data or controls, shall be ignored. In this way, it saves lots of time to retrieval an application tree.
public static final java.lang.String RFT_FIND_SEARCH_MODE_PREFIX
":RFSM:" case-insensitive prefix on entry path vector indicating recognition string is a RFT find search mode recognition string. In Rft-find-search-mode, RFT find API used to retrieve window and component objects.
public static final java.lang.String PROPERTYALL_SEARCH_MODE_PREFIX
":PASM:" With this prefix, for RS like "prop1=xxx;prop2=xxx;prop3=xxx", "prop1", "prop2" and "prop3" will all be considered as properties; Without this prefix, they will be considered as SAFS qualifier.
public static final java.lang.String[] recognitionStringPrefixes
protected java.lang.String childSeparator
protected java.util.Vector path
protected java.lang.String pathVector
protected boolean isFullPathSearchString
protected boolean isMappedClassSearchString
protected boolean isRftFindSearchString
protected boolean propertyAllSearchMode
protected java.util.Hashtable cache
protected java.lang.String windowName
protected java.lang.String childName
protected int process_mode
public GuiObjectVector()
Instances created with this minimal constructor MUST still have windowName, childName, and pathVector set prior to calling initGuiObjectRecognition().
public GuiObjectVector(java.lang.String window, java.lang.String child, java.lang.String pathString)
....subclass initialization completes....
initGuiObjectRecognition();
if pathString starts with :FPSM: then path is a fullpath search mode recognition string and we will set the search mode flag accordingly.
public void setFullPathSearchMode(boolean fullpathmode)
fullpathmode
- true if recognition string is for full path search mode.
false is for default Classic search mode recognition strings.public boolean isFullPathSearchMode()
public void setMappedClassSearchMode(boolean mappedclassmode)
mappedclassmode
- true if recognition string is for mapped class search mode.
false is for not mapped-class-search-mode recognition strings.public boolean isMappedClassSearchMode()
public boolean isRftFindSearchMode()
public void setRftFindSearchMode(boolean rftFindSearchMode)
rftFindSearchMode
- true if recognition string is for RFT find search mode.
false is for not RFT-find-search-mode recognition strings.public boolean isPropertyAllSearchMode()
public void setPropertyAllSearchMode(boolean propertyAllSearchMode)
propertyAllSearchMode
- booleanm, true if recognition string is for 'Property All' search mode.public void initGuiObjectRecognition()
Must be called by all GuiObjectVector subclass constructors AFTER their own constructor activities are complete.
....subclass initialization completes....
initGuiObjectRecognition();
public java.lang.String getVectorString()
public java.lang.String getWindowName()
public java.lang.String getChildName()
public int getRecognitionDepth()
public GuiObjectRecognition getParentGuiObjectRecognition()
We may also have to deal with the case where NO parent information is stored. Sometimes this is the case with the Object Recognition strings provided by the user for Process Container.
public GuiObjectRecognition getChildGuiObjectRecognition(int index)
An exception to this may exist when code like Process Container provides the parent object and the Object Recognition string does NOT provide parent path information but only child path information.
public GuiObjectRecognition getFinalChildGuiObjectRecognition()
protected java.lang.String getGuiObjectType(java.lang.Object _parent)
_parent
- - Will convert key if MODE_EXTERNAL_PROCESSING.GuiClassData.getMappedClassType(String, Object)
protected boolean isTopLevelPopupWindow(java.lang.Object _parent)
_parent
- - Will convert key if MODE_EXTERNAL_PROCESSING.getGuiObjectType(Object)
protected boolean isTopLevelPopupContainer(java.lang.Object _parent)
_parent
- - Will convert key if MODE_EXTERNAL_PROCESSING.getGuiObjectType(Object)
protected boolean isSeekingPopupMenu()
public boolean isMatchingParent(java.lang.Object _parent)
_parent
- - Will convert key if MODE_EXTERNAL_PROCESSING.public java.lang.Object getMatchingParentObject()
protected java.lang.Object iterateChildren(java.lang.Object _aparent, java.util.List gather)
_aparent
- - Will convert to object on MODE_EXTERNAL_PROCESSINGprotected java.util.Vector iterateChildMatchData(java.lang.Object _aparent, java.util.List gather)
public java.lang.Object getMatchingChildObject(java.lang.Object _aparent, java.util.List gather)
aparent
- - Will convert from d key on MODE_EXTERNAL_PROCESSINGgather,
- java.util.Listpublic java.util.Vector getChildMatchData(java.lang.Object _aparent, java.util.List gather)
aparent,
- TestObjectgather,
- java.util.Listprotected abstract GuiClassData getGuiClassData()
public abstract java.lang.Object[] getParentObjects()
public abstract java.lang.Object[] getDomainParentObjects(java.lang.String domainname)
domainname
- should be one of the supported org.safs.Domains constants like
"Java", "Html", "Win", etc..convertToKeys(Object[])
,
makeUniqueCacheKey(Object)
,
putCachedItem(Object, Object)
,
getCachedItem(Object)
public abstract java.lang.Object[] getChildObjects(java.lang.Object parent)
convertToKeys(Object[])
,
makeUniqueCacheKey(Object)
,
putCachedItem(Object, Object)
,
getCachedItem(Object)
public abstract boolean isValidGuiObject(java.lang.Object object)
getCachedItem(Object)
protected abstract boolean isValidGuiContainer(java.lang.Object object)
getCachedItem(Object)
protected abstract GuiObjectRecognition createGuiObjectRecognition(java.lang.String subpath, int govLevel)
protected abstract GuiChildIterator createGuiChildIterator(java.lang.Object aparent, GuiObjectVector govVector, java.util.List gather)
aparent
- is NOT a cached key, but should be the actual
engine-specific object that should have already been retrieved from
internal cache if MODE_EXTERNAL_PROCESSING.protected abstract GuiChildIterator createGuiChildIterator(java.util.List gather)
public java.lang.String getPathVector()
public static java.lang.String removeRStringPrefixes(java.lang.String pathVector, java.util.List<java.lang.String> list)
pathVector
- String, a recognition string that may start with prefixes.list
- Listpublic static boolean isMode(java.util.List<java.lang.String> prefixList, java.lang.String mode)
prefixList
- Listmode
- String, a ceratin mode like FULLPATH_SEARCH_MODE_PREFIX
, RFT_FIND_SEARCH_MODE_PREFIX
public static boolean isPASMMode(java.util.List<java.lang.String> prefixList)
public void setPathVector(java.lang.String pathVector)
pathVector
- The pathVector to set.public void setChildName(java.lang.String childName)
childName
- The childName to set.public void setWindowName(java.lang.String windowName)
windowName
- The windowName to set.public abstract void setActiveWindow(java.lang.Object _comp)
_comp
- is a String key used to retrieve cached items or an
engine-specific proxy implementation of the component itself. This is
usually one the objects returned in the Object[] from getParentObjects();getParentObjects()
,
getCachedItem(Object)
public void setProcessMode(int mode)
Engine processing is the typical usage when the engine controls the flow of component processing and uses largely engine-specific objects (like RFT TestObjects) to pass component references around within its own process space.
External processing is when an external process largely controls the flow of component processing and must usually resort to unique String keys to reference cached components in the engine process. This is the mode tools like ProcessContainer need to use.
When mode is (re)set to MODE_EXTERNAL_PROCESSING the internal reference cache will be (re)initialized and empty.
mode
- public int getProcessMode()
public void resetExternalModeCache()
protected java.lang.Object getCachedItem(java.lang.Object key)
key
- Object to use as lookup reference into cachemakeUniqueCacheKey(Object)
,
putCachedItem(Object, Object)
,
removeCachedItem(Object)
protected java.lang.Object removeCachedItem(java.lang.Object key)
key
- Object to use as lookup reference into cachemakeUniqueCacheKey(Object)
,
getCachedItem(Object)
,
putCachedItem(Object, Object)
protected void putCachedItem(java.lang.Object key, java.lang.Object item)
key
- Object to use as lookup reference into cache.item
- Item to store in the cache.java.lang.IllegalArgumentException
- if either key or item is null.makeUniqueCacheKey(Object)
,
getCachedItem(Object)
,
removeCachedItem(Object)
protected java.lang.String makeUniqueCacheKey(java.lang.Object item)
item
- to be stored in cache.putCachedItem(Object, Object)
,
getCachedItem(Object)
,
removeCachedItem(Object)
protected java.lang.Object[] convertToKeys(java.lang.Object[] items)
items
- Array of objects to store in the cache.makeUniqueCacheKey(Object)
,
putCachedItem(Object, Object)
,
getCachedItem(Object)
,
removeCachedItem(Object)
Copyright © SAS Institute. All Rights Reserved.