HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.transform.components
Class FunctionKeyComponent

java.lang.Object
  extended by com.ibm.hats.transform.components.Component
      extended by com.ibm.hats.transform.components.FunctionKeyComponent
All Implemented Interfaces:
IContextDependent, ICustomPropertySupplier

public class FunctionKeyComponent
extends Component
implements IContextDependent

The Function Key component is responsible for recognizing function (PF) keys. This component is used to transform static text on the host screen representing a function key into a button or link which your end user can click.

A recognized function key can be rendered by the following widgets:

The recognize() methods of this component return ComponentElement objects of type: The following settings can be configured for this component:

PropertyDescriptionTypeDefault Value
reqValueBeforeLeadingTokenOptional. The string that must precede the start delimiter. You can specify more than one value, separated by the ?|? (vertical bar) character. For a function key candidate to be recognized, it must be preceded by this value.String(one space)
startDelimiterRequired. The string that marks the beginning of the potential function key. You can specify more than one value, separated by the ?|? (vertical bar) character. Any of the values will be recognized as beginning a function key. This value can contains a ?#? (pound sign) ?which will be evaluated as ?a number? during recognition.StringPF#|F#| #=|#
delimiterOptional. The string that separates the start delimiter from the description. You can specify more than one value, separated by the ?|? (vertical bar) character.String=| - |-| = |:
reqValueAfterDescriptionOptional. The string that must immediately follow the description.String  |  (two spaces OR one space)


Field Summary
static String CLASS_NAME
           
static Properties defaults
           
static String PROPERTY_DELIMITER
           
static String PROPERTY_END_DELIMITER
           
static String PROPERTY_SEARCH_ORDER
           
static String PROPERTY_SEARCH_ORDER_ALL_ITEMS_FIRST
           
static String PROPERTY_SEARCH_ORDER_ENTIRE_KEY
           
static String PROPERTY_START_DELIMITER
           
static String PROPERTY_VALUE_BEFORE_LEADING_TOKEN
           
 
Fields inherited from class com.ibm.hats.transform.components.Component
contextAttributes, flag, hostScreen
 
Fields inherited from interface com.ibm.hats.common.ICustomPropertySupplier
CLASSNAME
 
Constructor Summary
FunctionKeyComponent(HsrScreen hostScreen)
          Constructs a new FunctionKeyComponent object.
 
Method Summary
 String[] createPossibleKeys(String[] startDelimiters, Properties settings)
          Retuns an array of "expanded" String objects.
 String[] expandDelimiters(String[] delimiters, Properties settings)
          Retuns an array of "expanded" String objects.
 List findAllFunctionKeysSeparatelyInRow(String line, int startPos, String[] valueBeforeStartDelimiters, String[] startDelimiters, String[] delimiters, String[] endDelimiters, Properties settings)
          Deprecated.  
protected static int findFirstIndexOfDelimiter(String line, String[] delimiters)
          Return the first index (0-based) of the specified line which is the start of one of the specified delimiters.
 List findFunctionKeysInRow(String line, int startPos, String[] valueBeforeStartDelimiters, String[] startDelimiters, String[] delimiters, String[] endDelimiters, Properties settings, String followString)
          Deprecated.  
 List findFunctionKeysInRow2(String line, int startPos, String[] valueBeforeStartDelimiters, String[] startDelimiters, String[] delimiters, String[] endDelimiters, Properties settings, String followString)
          Deprecated.  
 String[] getBeforeLeadingToken(Properties settings)
          Returns a String array of strings which can preceed the candidate function key.
 Vector getCustomProperties(int iPageNumber, Properties properties, ResourceBundle bundle)
          Returns a list of this object's custom properties.
 int getPropertyPageCount()
          Returns the number of property pages associated with this object.
 String[] getStartDelimiter(Properties settings)
          Returns a String array of start delimiters.
 boolean isAllowed(ContextAttributes contextAttributes)
          Gets whether or not this object should be visible in the studio given some context attributes.
 boolean isPropertyAllowed(String name, ContextAttributes contextAttributes)
          Gets whether or not the specified property should be visible in the component or widget settings.
 ComponentElement[] recognize(BlockScreenRegion region, Properties settings)
          Method to recognize components in the specified BlockScreenRegion using the specified settings.
 ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region, Properties settings)
          Not currently implemented.
 
Methods inherited from class com.ibm.hats.transform.components.Component
convertPosToCol, convertPosToRow, convertRowColToPos, findFirstDelimiterIndex, findFirstIndexOf, findFirstIndexOf, findFirstIndexOf, findFirstNonWhitespaceIndex, findFirstNonWhitespaceIndex, findFirstNonWhitespaceIndex, getContextAttribute, getContextAttributes, getCustomComposite, getDefaultValues, getHostScreen, getTrailingSpaceCount, newInstance, recognize, setContextAttribute, setContextAttributes, setHostScreen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final String CLASS_NAME
See Also:
Constant Field Values

PROPERTY_START_DELIMITER

public static final String PROPERTY_START_DELIMITER
See Also:
Constant Field Values

PROPERTY_DELIMITER

public static final String PROPERTY_DELIMITER
See Also:
Constant Field Values

PROPERTY_VALUE_BEFORE_LEADING_TOKEN

public static final String PROPERTY_VALUE_BEFORE_LEADING_TOKEN
See Also:
Constant Field Values

PROPERTY_END_DELIMITER

public static final String PROPERTY_END_DELIMITER
See Also:
Constant Field Values

PROPERTY_SEARCH_ORDER

public static final String PROPERTY_SEARCH_ORDER
See Also:
Constant Field Values

PROPERTY_SEARCH_ORDER_ENTIRE_KEY

public static final String PROPERTY_SEARCH_ORDER_ENTIRE_KEY
See Also:
Constant Field Values

PROPERTY_SEARCH_ORDER_ALL_ITEMS_FIRST

public static final String PROPERTY_SEARCH_ORDER_ALL_ITEMS_FIRST
See Also:
Constant Field Values

defaults

public static Properties defaults
Constructor Detail

FunctionKeyComponent

public FunctionKeyComponent(HsrScreen hostScreen)
Constructs a new FunctionKeyComponent object.

Parameters:
hostScreen - HostScreen to look for function keys in.
Method Detail

getStartDelimiter

public String[] getStartDelimiter(Properties settings)
Returns a String array of start delimiters.

Parameters:
settings - The Properties settings.
Returns:
A String array of start delimiters.

getBeforeLeadingToken

public String[] getBeforeLeadingToken(Properties settings)
Returns a String array of strings which can preceed the candidate function key.

Parameters:
settings - The Properties settings.
Returns:
A String array of strings which can preceed the candidate function key.

recognize

public ComponentElement[] recognize(BlockScreenRegion region,
                                    Properties settings)
Description copied from class: Component
Method to recognize components in the specified BlockScreenRegion using the specified settings.

This method must be implemented if the base class is subclassed.

Specified by:
recognize in class Component
Parameters:
region - BlockScreenRegion to search in
settings - recognition settings
Returns:
an array of ComponentElement objects.
See Also:
Component.recognize(ScreenRegion, Properties)

recognize

public ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region,
                                    Properties settings)
Not currently implemented.

Specified by:
recognize in class Component

createPossibleKeys

public String[] createPossibleKeys(String[] startDelimiters,
                                   Properties settings)
Retuns an array of "expanded" String objects. Expansion involves converting any # (pound) symbols into a set of delimiters.

Parameters:
startDelimiters - The array of start delimiters.
settings - The settings.
Returns:
An array of "expanded" String objects. Expansion involves converting any # (pound) symbols into a set of delimiters.

findAllFunctionKeysSeparatelyInRow

public List findAllFunctionKeysSeparatelyInRow(String line,
                                               int startPos,
                                               String[] valueBeforeStartDelimiters,
                                               String[] startDelimiters,
                                               String[] delimiters,
                                               String[] endDelimiters,
                                               Properties settings)
Deprecated. 

Retuns a java.util.List containing FunctionKeyComponentElement objects, each respresenting a function key found in the specified line.

Parameters:
line - String to look for function keys in.
startPos - the (1-based) linear start position of the first character of the line. This is used to set the consumed region for each function key component element.
valueBeforeStartDelimiters - array of strings which
startDelimiters - array of potential start delimiters
delimiters - array of potential delimiters
endDelimiters - array of potential end delimiters
settings -
Returns:
java.util.List of FunctionKeyComponentElement objects

findFunctionKeysInRow2

public List findFunctionKeysInRow2(String line,
                                   int startPos,
                                   String[] valueBeforeStartDelimiters,
                                   String[] startDelimiters,
                                   String[] delimiters,
                                   String[] endDelimiters,
                                   Properties settings,
                                   String followString)
Deprecated. 

Retuns a java.util.List containing FunctionKeyComponentElement objects, each respresenting a function key found in the specified line.

Parameters:
line - String to look for function keys in.
startPos - the (1-based) linear start position of the first character of the line. This is used to set the consumed region for each function key component element.
valueBeforeStartDelimiters - array of strings which
startDelimiters - array of potential start delimiters
delimiters - array of potential delimiters
endDelimiters - array of potential end delimiters
settings -
followString -
Returns:
java.util.List of FunctionKeyComponentElement objects

findFunctionKeysInRow

public List findFunctionKeysInRow(String line,
                                  int startPos,
                                  String[] valueBeforeStartDelimiters,
                                  String[] startDelimiters,
                                  String[] delimiters,
                                  String[] endDelimiters,
                                  Properties settings,
                                  String followString)
Deprecated. 

Retuns a java.util.List containing FunctionKeyComponentElement objects, each respresenting a function key found in the specified line.

Parameters:
line - String to look for function keys in.
startPos - the (1-based) linear start position of the first character of the line. This is used to set the consumed region for each function key component element.
valueBeforeStartDelimiters - array of strings which
startDelimiters - array of potential start delimiters
delimiters - array of potential delimiters
endDelimiters - array of potential end delimiters
settings -
followString -
Returns:
java.util.List of FunctionKeyComponentElement objects

findFirstIndexOfDelimiter

protected static int findFirstIndexOfDelimiter(String line,
                                               String[] delimiters)
Return the first index (0-based) of the specified line which is the start of one of the specified delimiters.

Parameters:
line - The String to be searched.
delimiters - An array of delimiters to search for.
Returns:
The first index (0-based) of the specified line which is the start of one of the specified delimiters.

expandDelimiters

public String[] expandDelimiters(String[] delimiters,
                                 Properties settings)
Retuns an array of "expanded" String objects. Expansion involves converting any # (pound) symbols into a set of delimiters.

Parameters:
delimiters - An array of delimiters.
settings - The settings.
Returns:
An array of "expanded" String objects. Expansion involves converting any # (pound) symbols into a set of delimiters.

getPropertyPageCount

public int getPropertyPageCount()
Description copied from interface: ICustomPropertySupplier
Returns the number of property pages associated with this object.

Note: Currently only 0 or 1 pages are supported.

Specified by:
getPropertyPageCount in interface ICustomPropertySupplier
Overrides:
getPropertyPageCount in class Component
Returns:
the number of defined property pages used to configure this object, or 0 if there are none

getCustomProperties

public Vector getCustomProperties(int iPageNumber,
                                  Properties properties,
                                  ResourceBundle bundle)
Description copied from interface: ICustomPropertySupplier
Returns a list of this object's custom properties. Items must be of type com.ibm.hats.common.HCustomProperty.

Specified by:
getCustomProperties in interface ICustomPropertySupplier
Overrides:
getCustomProperties in class Component
Parameters:
iPageNumber - page number containing desired properties
properties - existing values for properties defined here
bundle - ResourceBundle containing NLS descriptions for the properties
Returns:
Vector containing all the custom properties for this object, or null if there are none
See Also:
HCustomProperty

isAllowed

public boolean isAllowed(ContextAttributes contextAttributes)
Description copied from interface: IContextDependent
Gets whether or not this object should be visible in the studio given some context attributes. The context attributes may contain the Component name when this is called on a Widget, or whether or not we are presenting this Component/Widget choice while configuring Default Rendering.

Specified by:
isAllowed in interface IContextDependent
Returns:
whether or not this Component or Widget is allowed in the specified context

isPropertyAllowed

public boolean isPropertyAllowed(String name,
                                 ContextAttributes contextAttributes)
Description copied from interface: IContextDependent
Gets whether or not the specified property should be visible in the component or widget settings. The context attributes may contain the Component name when this is called on a Widget, or whether or not we are presenting this Component/Widget choice while configuring Default Rendering.

Specified by:
isPropertyAllowed in interface IContextDependent
Parameters:
name - property name
Returns:
whether or not this property is allowed in the specified context

HATS 7.5.1 (201005110649)