org.safs
Class GuiObjectVector

java.lang.Object
  extended by org.safs.GuiObjectVector
Direct Known Subclasses:
AGuiObjectVector, RGuiObjectVector

public abstract class GuiObjectVector
extends java.lang.Object

This class is intended to maintain critical component recognition information for each level of the application GUI hierarchy represented in a standard component recognition string.


Copyright (C) (SAS) All rights reserved.
General Public License: http://www.opensource.org/licenses/gpl-license.php

Since:

JUL 15, 2005 (CANAGL) Added JavaClass support
APR 17, 2009 (CANAGL) Fixed problem in makeUniqueCacheKey
APR 23, 2009 (CANAGL) Added support for fullpath search mode(:FPSM:).
MAY 01, 2009 (CANAGL) Changes to complete FULLPATH_SEARCH_MODE implementation.
MAY 11, 2009 (CANAGL) Support JPopups as child Panels in JFrames.
JUL 20, 2009 (CANAGL) Added Domain= Category support.
SEP 04, 2009 (Junwu) Added mapped class search mode and complete MAPPEDCLASS_SEARCH_MODE(:MCSM:) implementation.
NOV 17, 2009 (LeiWang) Added constant "PopupWindow" to represent generic top level popup window,use it in method isSeekingPopupMenu() and isTopLevelPopupWindowType().
DEC 09, 2009 (CANAGL) Fixed case-sensitive comparison error in isSeekingPopupMenu. Added "PopupMenu" support in isTopLevelPopupWindowType().
APR 23, 2010 (CANAGL) Mode convertToKeys handling case of individual null items in arrays.
MAR 09,2011 (DharmeshPatel) Added RFT Find Search Mode (:RFSM:) implementation.

Field Summary
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[] 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 Summary
GuiObjectVector()
          Alternate minimal constructor.
GuiObjectVector(java.lang.String window, java.lang.String child, java.lang.String pathString)
          Primary constructor for the superclass.
 
Method Summary
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)
           
 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.ArrayList 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CHILD_SEPARATOR

public static final java.lang.String DEFAULT_CHILD_SEPARATOR
";\;" -- separates parent/child relationships in recognition strings.

See Also:
Constant Field Values

DESKTOP_REFERENCE

public static final java.lang.String DESKTOP_REFERENCE
"\;" -- Reference to the Desktop. This is only valid when used as the first leading text of a recognition string.

See Also:
Constant Field Values

ACTIVE_WINDOW_REFERENCE

public static final java.lang.String ACTIVE_WINDOW_REFERENCE
".\;" -- Reference to the current active window. This is only valid when used as the first leading text of a recognition string.

See Also:
Constant Field Values

OBJECTTYPE_POPUPWINDOW

public static final java.lang.String OBJECTTYPE_POPUPWINDOW
"JavaPopupWindow" -- The "sought" object type for top level popup menu window.

See Also:
Constant Field Values

GENERIC_OBJECTTYPE_POPUPWINDOW

public static final java.lang.String GENERIC_OBJECTTYPE_POPUPWINDOW
"POPUPWINDOW" -- The upper-case generic "sought" object type for top level popup menu window.

See Also:
Constant Field Values

OBJECTTYPE_POPUPCONTAINER

public static final java.lang.String OBJECTTYPE_POPUPCONTAINER
"JavaPopupContainer" -- A JFrame can contain an active JavaPopupMenu.

See Also:
Constant Field Values

OBJECTTYPE_POPUPMENU

public static final java.lang.String OBJECTTYPE_POPUPMENU
"JavaPopupMenu" -- The "sought" object type for java popup menus.

See Also:
Constant Field Values

DOTNET_POPUPMENU

public static final java.lang.String DOTNET_POPUPMENU
See Also:
Constant Field Values

WIN_POPUPMENU

public static final java.lang.String WIN_POPUPMENU
See Also:
Constant Field Values

SIMPLETYPE_POPUPMENU

public static final java.lang.String SIMPLETYPE_POPUPMENU
"POPUPMENU" -- The upper-case "simple" object type for popup menus.

See Also:
Constant Field Values

MODE_ENGINE_PROCESSING

public static final int MODE_ENGINE_PROCESSING
See Also:
Constant Field Values

MODE_EXTERNAL_PROCESSING

public static final int MODE_EXTERNAL_PROCESSING
See Also:
Constant Field Values

INITIAL_CACHE_SIZE

public static final int INITIAL_CACHE_SIZE
See Also:
Constant Field Values

FULLPATH_SEARCH_MODE_PREFIX

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.

See Also:
Constant Field Values

MAPPEDCLASS_SEARCH_MODE_PREFIX

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.

See Also:
Constant Field Values

RFT_FIND_SEARCH_MODE_PREFIX

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.

See Also:
Constant Field Values

recognitionStringPrefixes

public static final java.lang.String[] recognitionStringPrefixes
List of all R-String prefixes supported by SAFS


childSeparator

protected java.lang.String childSeparator
Stores the defined parent/child separator.


path

protected java.util.Vector path
Holds full hierarchy of GuiObjectRecognition objects.


pathVector

protected java.lang.String pathVector
Stores the full recognition string provided to the constructor. It is a pure recognition string, from which any prefix defined in recognitionStringPrefixes will be removed.


isFullPathSearchString

protected boolean isFullPathSearchString
True for FullPath Search Mode. False for default Classic Search Mode.


isMappedClassSearchString

protected boolean isMappedClassSearchString
True for MappedClass Search Mode. False for default other Search Mode.


isRftFindSearchString

protected boolean isRftFindSearchString
True for RFT Find Search Mode. False for default other Search Mode.


cache

protected java.util.Hashtable cache

windowName

protected java.lang.String windowName
Stores the name of the window component involved in our search. windowName and childName may be indentical if the window is the target.


childName

protected java.lang.String childName
Stores the name of the child component involved in our search. windowName and childName may be indentical if the window is the target.


process_mode

protected int process_mode
Constructor Detail

GuiObjectVector

public GuiObjectVector()
Alternate minimal constructor. All subclasses should call this constructor with


GuiObjectVector

public GuiObjectVector(java.lang.String window,
                       java.lang.String child,
                       java.lang.String pathString)
Primary constructor for the superclass. All subclasses should call this constructor with

if pathString starts with :FPSM: then path is a fullpath search mode recognition string and we will set the search mode flag accordingly.

Method Detail

setFullPathSearchMode

public void setFullPathSearchMode(boolean fullpathmode)
Set to true to specify recognition string is a full path search mode recognition string.

Parameters:
fullpathmode - true if recognition string is for full path search mode. false is for default Classic search mode recognition strings.

isFullPathSearchMode

public boolean isFullPathSearchMode()
Returns:
true if the initialized path vector represented a full path search mode recognition string. False is for default Classic search mode recognition strings.

setMappedClassSearchMode

public void setMappedClassSearchMode(boolean mappedclassmode)
Set to true to specify recognition string is a mapped class search mode recognition string.

Parameters:
mappedclassmode - true if recognition string is for mapped class search mode. false is for not mapped-class-search-mode recognition strings.

isMappedClassSearchMode

public boolean isMappedClassSearchMode()
Returns:
true if the initialized path vector represented a mapped class search mode recognition string. False is for not mapped-class-search-mode recognition strings.

isRftFindSearchMode

public boolean isRftFindSearchMode()
Returns:
true if the initialized path vector represented a RFT find search mode recognition string. False is for not RFT-find-search-mode recognition strings.

setRftFindSearchMode

public void setRftFindSearchMode(boolean rftFindSearchMode)
Set to true to specify recognition string is a RFT find search mode recognition string.

Parameters:
rftFindSearchMode - true if recognition string is for RFT find search mode. false is for not RFT-find-search-mode recognition strings.

initGuiObjectRecognition

public void initGuiObjectRecognition()
Initialize path vector storage with GuiObjectRecognition objects. This routine breaks down a standard component recogntion string into separate parent/child elements represented by GuiObjectRecognition objects.

Must be called by all GuiObjectVector subclass constructors AFTER their own constructor activities are complete.


getVectorString

public java.lang.String getVectorString()
Stores the constructors pathString.


getWindowName

public java.lang.String getWindowName()
Stores the constructors window string.


getChildName

public java.lang.String getChildName()
Stores the constructors child string.


getRecognitionDepth

public int getRecognitionDepth()
Returns the hierarchy depth of the pathString when available. This is the number of GuiObjectRecognition objects stored in our path vector.


getParentGuiObjectRecognition

public GuiObjectRecognition getParentGuiObjectRecognition()
Returns the topmost parent GuiObjectRecognition. In most cases this is the first GuiObjectRecognition stored. However, some cases referencing the Desktop ("\;") will change this to be the second GuiObjectRecognition stored.

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.


getChildGuiObjectRecognition

public GuiObjectRecognition getChildGuiObjectRecognition(int index)
Returns the indexed GuiObjectRecognition stored. The parent object is at index=0 (or index=1 if DESKTOP_REFERENCE exists). The first child is usually at index=1 (or 2).

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.


getFinalChildGuiObjectRecognition

public GuiObjectRecognition getFinalChildGuiObjectRecognition()
Returns the last GuiObjectRecognition stored--the one for final match.


getGuiObjectType

protected java.lang.String getGuiObjectType(java.lang.Object _parent)
Parameters:
_parent - - Will convert key if MODE_EXTERNAL_PROCESSING.
Returns:
the object type(s) as mapped via GuiClassData or NULL.
See Also:
GuiClassData.getMappedClassType(String, Object)

isTopLevelPopupWindow

protected boolean isTopLevelPopupWindow(java.lang.Object _parent)
Parameters:
_parent - - Will convert key if MODE_EXTERNAL_PROCESSING.
Returns:
true if the _parent maps strictly to a PopupMenu Window class. This excludes the test for a JavaPopupContainer--like JFrame. We don't want just any old JFrame considered a match as a Parent object with Type=JavaPopupMenu.
See Also:
getGuiObjectType(Object)

isTopLevelPopupContainer

protected boolean isTopLevelPopupContainer(java.lang.Object _parent)
Parameters:
_parent - - Will convert key if MODE_EXTERNAL_PROCESSING.
Returns:
true if the _parent maps to a PopupMenu Window OR JavaPopupContainer-- like JFrame. This is generally when searching for child objects matching Type=JavaPopupMenu when they are contained inside a parent window not normally considered a top-level Popup window--like JFrame.
See Also:
getGuiObjectType(Object)

isSeekingPopupMenu

protected boolean isSeekingPopupMenu()
Only reference recognition string and no specific object.


isMatchingParent

public boolean isMatchingParent(java.lang.Object _parent)
Parameters:
_parent - - Will convert key if MODE_EXTERNAL_PROCESSING.

getMatchingParentObject

public java.lang.Object getMatchingParentObject()
Searches the test domains one-by-one in the order received from Domains.getEnabledDomains(). Thus, if the order of enabled domains is {Java, Html, Win} then we will first check ALL Java domains for the match, then all Html domains, and finally all Win domains. Find the one parent object that matches our recognition string.

Returns:
Object or null if no match found. Will be a cached key from getParentObjects if MODE_EXTERNAL_PROCESSING.

iterateChildren

protected java.lang.Object iterateChildren(java.lang.Object _aparent,
                                           java.util.List gather)
used by getMatchingChildObject below.

Parameters:
_aparent - - Will convert to object on MODE_EXTERNAL_PROCESSING
Returns:
Object - Will convert to cached key on MODE_EXTERNAL_PROCESSING

iterateChildMatchData

protected java.util.Vector iterateChildMatchData(java.lang.Object _aparent,
                                                 java.util.List gather)

getMatchingChildObject

public java.lang.Object getMatchingChildObject(java.lang.Object _aparent,
                                               java.util.List gather)
get child test object

Parameters:
aparent - - Will convert from d key on MODE_EXTERNAL_PROCESSING
gather, - java.util.List
Returns:
Object or null - Object will be a cached key on MODE_EXTERNAL_PROCESSING

getChildMatchData

public 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. Normally, this is just one object. But with a recognition string that merely requests one particular type or class of object we can get all such matches. For example, we can provide an HTMLDocument object and request to retrieve all HTMLLinks within that document.

Parameters:
aparent, - TestObject
gather, - java.util.List
Returns:
Vector null or all GuiChildIterator MatchData

getGuiClassData

protected abstract GuiClassData getGuiClassData()
Return the subclass of GuiClassData used by your tool.


getParentObjects

public abstract java.lang.Object[] getParentObjects()
Return an array representing all known parent windows. If getProcessMode()==MODE_EXTERNAL_PROCESSING the returned array should actually be an array of keys created from convertToKeys and\or makeUniqueCacheKey.

See Also:
convertToKeys(Object[]), makeUniqueCacheKey(Object), putCachedItem(Object, Object), getCachedItem(Object)

getDomainParentObjects

public abstract java.lang.Object[] getDomainParentObjects(java.lang.String domainname)
Return an array representing all known parent windows from one single domain. If getProcessMode()==MODE_EXTERNAL_PROCESSING the returned array should actually be an array of keys created from convertToKeys and\or makeUniqueCacheKey.

Parameters:
domainname - should be one of the supported org.safs.Domains constants like "Java", "Html", "Win", etc..
See Also:
convertToKeys(Object[]), makeUniqueCacheKey(Object), putCachedItem(Object, Object), getCachedItem(Object)

getChildObjects

public abstract java.lang.Object[] getChildObjects(java.lang.Object parent)
Return an array representing all known child objects of the parent. If getProcessMode()==MODE_EXTERNAL_PROCESSING the implementor should assume the parent is actually stored in the internal cache and the parent in hand is actually a key to the cached object that must be retrieved using getCachedItem(object). Also, if getProcessMode()==MODE_EXTERNAL_PROCESSING the returned array should actually be an array of keys created from convertToKeys and\or makeUniqueCacheKey.

Returns:
array of objects or an empty array of new Object[0].
See Also:
convertToKeys(Object[]), makeUniqueCacheKey(Object), putCachedItem(Object, Object), getCachedItem(Object)

isValidGuiObject

public abstract boolean isValidGuiObject(java.lang.Object object)
Return true if the provided object represents a valid gui component. If getProcessMode()==MODE_EXTERNAL_PROCESSING the implementor should assume the object is actually stored in the internal cache and the object in hand is actually a key to the cached object that must be retrieved using getCachedItem(object).

See Also:
getCachedItem(Object)

isValidGuiContainer

protected abstract boolean isValidGuiContainer(java.lang.Object object)
Return true if the provided object represents a gui container. If getProcessMode()==MODE_EXTERNAL_PROCESSING the implementor should assume the object is actually stored in the internal cache and the object in hand is actually a key to the cached object that must be retrieved using getCachedItem(object).

See Also:
getCachedItem(Object)

createGuiObjectRecognition

protected abstract GuiObjectRecognition createGuiObjectRecognition(java.lang.String subpath,
                                                                   int govLevel)
Return a GuiObjectRecognition subclass instance.


createGuiChildIterator

protected abstract GuiChildIterator createGuiChildIterator(java.lang.Object aparent,
                                                           GuiObjectVector govVector,
                                                           java.util.List gather)
Return a GuiChildIterator subclass instance.

Parameters:
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.

createGuiChildIterator

protected abstract GuiChildIterator createGuiChildIterator(java.util.List gather)
Return a GuiChildIterator subclass instance.


getPathVector

public java.lang.String getPathVector()
Returns:
Returns the pathVector.

removeRStringPrefixes

public static java.lang.String removeRStringPrefixes(java.lang.String pathVector,
                                                     java.util.ArrayList list)
Remove prefixes known by SAFS from a recognition string, return the left part and a list of prefixes removed. The known prefixes are defined in recognitionStringPrefixes[].

Parameters:
pathVector, - a recognition string that may start with prefixes.
list, - returned list that contains prefixes SAFS can handle.
Returns:
a string that has been removed prefixes from.

setPathVector

public 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. The routine will check the provided path vector for the FULLPATH_SEARCH_MODE_PREFIX (:FPSM:) and setFullPathSearchMode; for the MAPPEDCLASS_SEARCH_MODE_PREFIX (:MCSM:) and setMappedClassSearchMode for the RFT_FIND_SEARCH_MODE (:RFSM:) and setRftFindSearchMode accordingly. If the prefix exists it is removed prior to setting the official pathVector.

Parameters:
pathVector - The pathVector to set.

setChildName

public 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.

Parameters:
childName - The childName to set.

setWindowName

public 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.

Parameters:
windowName - The windowName to set.

setActiveWindow

public abstract void setActiveWindow(java.lang.Object _comp)
Make the Window referenced by _comp the active window. If getProcessMode()==MODE_EXTERNAL_PROCESSING the implementor should assume the _comp is actually stored in the internal cache and the _comp in hand is actually a key to the cached object that must be retrieved using getCachedItem(object).

Parameters:
_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();
See Also:
getParentObjects(), getCachedItem(Object)

setProcessMode

public void setProcessMode(int mode)
As of initial writing, there are two modes in which Gui object usage may differ inside a running engine:

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.

Parameters:
mode -

getProcessMode

public int getProcessMode()
Return the current setting for processing mode. Valid values: MODE_ENGINE_PROCESSING, MODE_EXTERNAL_PROCESSING


resetExternalModeCache

public void resetExternalModeCache()
Clear and\or reset the internal component cache used in non-typical modes of operation like MODE_EXTERNAL_PROCESSING (Process Container).

See Also:
makeUniqueCacheKey(Object), putCachedItem(Object, Object), getCachedItem(Object), removeCachedItem(Object)

getCachedItem

protected java.lang.Object getCachedItem(java.lang.Object key)
Attempts to retrieve an item from cache using the provided key. If the key is a String, will attempt to convert it to upper-case before using it. If not found will attempt to use key as-is. If not found will return key as-is.

Parameters:
key - Object to use as lookup reference into cache
Returns:
Object stored in cache or key as provided.
See Also:
makeUniqueCacheKey(Object), putCachedItem(Object, Object), removeCachedItem(Object)

removeCachedItem

protected java.lang.Object removeCachedItem(java.lang.Object key)
Remove an item from cache. Will attempt to use key as-is. If item is not found and the key is a String, will attempt to convert it to upper-case before using it.

Parameters:
key - Object to use as lookup reference into cache
Returns:
the Object removed or null if not found.
See Also:
makeUniqueCacheKey(Object), getCachedItem(Object), putCachedItem(Object, Object)

putCachedItem

protected void putCachedItem(java.lang.Object key,
                             java.lang.Object item)
Attempts to put an item in cache using the provided key. If the key is a String, will convert it to upper-case before using it. The routine will initialize the cache if it does not exist.

Parameters:
key - Object to use as lookup reference into cache.
item - Item to store in the cache.
Throws:
java.lang.IllegalArgumentException - if either key or item is null.
See Also:
makeUniqueCacheKey(Object), getCachedItem(Object), removeCachedItem(Object)

makeUniqueCacheKey

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.

Parameters:
item - to be stored in cache.
Returns:
unique String suitable to be the key for the item.
See Also:
putCachedItem(Object, Object), getCachedItem(Object), removeCachedItem(Object)

convertToKeys

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. The items will be stored in the cache using the unique keys.

Parameters:
items - Array of objects to store in the cache.
Returns:
an array of object keys used to retrieve the items from the cache.
See Also:
makeUniqueCacheKey(Object), putCachedItem(Object, Object), getCachedItem(Object), removeCachedItem(Object)