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 ItemSelectionComponent

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

public class ItemSelectionComponent
extends Component
implements IContextDependent

The Item Selection component is responsible for recognizing item selection lists (aka menus) in a specified region of a host screen.

A recognized item selection list 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
reqValueBeforeLeadingTokenThe string which precedes the leading token of each list item.String(two spaces)
leadingTokenTypeSpecifies whether each list item starts with letters, digits, or both letters and digits.enumEITHER
maxLeadingTokenLengthSpecifies the maximum length of the leading token (used to help restrict what gets recognized as a list item).int4
delimiterThe string of characters between the leading token and the description. You can specify more than one value, separated by the "|" (vertical bar) character.String". |- " (period space OR dash space)
stringAfterCaptionThe string of characters which must follow each list itemString(two spaces)
minimumReqOptionsThe minimum number of list items that must be found in order for the selected region to be recognized as a selection list.int2
targetSpecifies which input field receives the selection. Options: FIRST, LAST, PREVIOUS, NEXT, SPECIFIED, CURSOR.enumNEXT
targetFieldRowSpecifies the row of the input field which should receive the selection. Note: This setting only applies if "SPECIFIED" is selected as the selection target.int-1
targetFieldColSpecifies the column of the input field which should receive the selection. Note: This setting only applies if "SPECIFIED" is selected as the selection target.int-1
actionKeySpecifies the host aid key that should be pressed after the target input field has been updated with the end user's selection. The default value is "[enter]" meaning that the enter key will be pressed once the user makes a selection.String[enter]
sortSelectionsIf true, list items are sorted according to either their leading token or description (see below for more information on other settings).booleanfalse
sortBySpecifies whether to sort the set of list options by their leading token or description. Valid values: ITEM or DESCRIPTIONenumITEM
sortOrderSpecifies whether to sort the set of list options in ascending or descending order. Note: The locale-sensitive sorting methods, built into Java, are used to perform this operation. Valid values: ASCENDING or DESCENDINGenumASCENDING
convertActionNumberIf your host displays full-width characters for the list items' leading token, but it expects the item to be entered into the target input field as single-byte characters, then this parameter must be enabled. This will convert the DBCS item into a SBCS item before it is sent to the host. This setting does not apply for items which are displayed as single-byte characters on the host.booleantrue
placeholdersSpecifies whether to embed placeholder list items when gaps (i.e. empty space) exist between list items. Valid values: NONE, SINGLE, or ACTUAL.enumACTUAL
maxSpaceAfterDelimiterSpecifies the maximum number of space characters between the end of the delimiter and the start of the captionint5

Example
In the following example, "1" is the leading token, ". " is the delimiter, "User tasks" is the caption, and " " (two spaces) is the end delimiter:

1. User tasks

See Also:
InputComponentElement

Field Summary
static String CLASS_NAME
           
static Properties defaults
           
static String PROPERTY_CAPTIONS_LAST
           
static String PROPERTY_CLIP_INPUT_FIELDS
           
static String PROPERTY_EXTRACT_CAPTIONS
           
static String PROPERTY_MUST_HAVE_CAPTION
           
static String PROPERTY_STRIP_AFTER_DELIMITERS
           
static String PROPERTY_STRIP_CAPTIONS
           
static String PROPERTY_STRIP_REPLACE_WITH
           
static String PROPERTY_TRIM_CAPTIONS
           
 
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
ItemSelectionComponent(HsrScreen hostScreen)
          Constructs a new ItemSelectionComponent object.
 
Method Summary
protected  String deshape(String s)
           
static String getBlockScreenRegionString(BlockScreenRegion bsr, HsrScreen hs, String strbreak)
          Gets the rectangle defined in the block screen region as a string.
 Vector getCustomProperties(int iPageNumber, Properties properties, ResourceBundle bundle)
          Returns a list of this object's custom properties.
 Properties getDefaultValues(int iPageNumber)
          Returns this object's default property values.
 String getFieldCaption(int fieldStartPos, int startCol, int endCol, boolean clip, boolean strip, String[] stripAfterDelimiters, String stripReplaceWith, boolean captionlast, boolean trim, BlockScreenRegion region)
          Returns a String caption for the input field at the specified fieldStartPos.
 int getPropertyPageCount()
          Returns the number of property pages associated with this object.
 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)
          Returns an array of InputComponentElement objects representing each selection list found in the specified region of the screen.
 ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region, Properties settings)
          Currently not implemented.
 
Methods inherited from class com.ibm.hats.transform.components.Component
convertPosToCol, convertPosToRow, convertRowColToPos, findFirstDelimiterIndex, findFirstIndexOf, findFirstIndexOf, findFirstIndexOf, findFirstNonWhitespaceIndex, findFirstNonWhitespaceIndex, findFirstNonWhitespaceIndex, getContextAttribute, getContextAttributes, getCustomComposite, 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_CLIP_INPUT_FIELDS

public static final String PROPERTY_CLIP_INPUT_FIELDS
See Also:
Constant Field Values

PROPERTY_EXTRACT_CAPTIONS

public static final String PROPERTY_EXTRACT_CAPTIONS
See Also:
Constant Field Values

PROPERTY_STRIP_CAPTIONS

public static final String PROPERTY_STRIP_CAPTIONS
See Also:
Constant Field Values

PROPERTY_STRIP_AFTER_DELIMITERS

public static final String PROPERTY_STRIP_AFTER_DELIMITERS
See Also:
Constant Field Values

PROPERTY_STRIP_REPLACE_WITH

public static final String PROPERTY_STRIP_REPLACE_WITH
See Also:
Constant Field Values

PROPERTY_TRIM_CAPTIONS

public static final String PROPERTY_TRIM_CAPTIONS
See Also:
Constant Field Values

PROPERTY_CAPTIONS_LAST

public static final String PROPERTY_CAPTIONS_LAST
See Also:
Constant Field Values

PROPERTY_MUST_HAVE_CAPTION

public static final String PROPERTY_MUST_HAVE_CAPTION
See Also:
Constant Field Values

defaults

public static Properties defaults
Constructor Detail

ItemSelectionComponent

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

Method Detail

recognize

public ComponentElement[] recognize(BlockScreenRegion region,
                                    Properties settings)
Returns an array of InputComponentElement objects representing each selection list found in the specified region of the screen.

Specified by:
recognize in class Component
Parameters:
region - rectangular region to search in
settings - recognition settings (see the table above)
Returns:
An array of InputComponentElement objects.
See Also:
Component.recognize(BlockScreenRegion, Properties), InputComponentElement

recognize

public ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region,
                                    Properties settings)
Description copied from class: Component
Currently not implemented.

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

Specified by:
recognize in class Component
See Also:
Component.recognize(LinearScreenRegion, Properties)

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

getFieldCaption

public String getFieldCaption(int fieldStartPos,
                              int startCol,
                              int endCol,
                              boolean clip,
                              boolean strip,
                              String[] stripAfterDelimiters,
                              String stripReplaceWith,
                              boolean captionlast,
                              boolean trim,
                              BlockScreenRegion region)
Returns a String caption for the input field at the specified fieldStartPos.

Parameters:
fieldStartPos - Linear (1-based) start position of the input field to find the caption for.
startCol - (1-based) start column of the region.
endCol - (1-based) end column of the region.
clip - If true clip input field.
strip - If true, strip the end of the string starting with the first found "stripAfterDelimiter".
stripAfterDelimiters - Array of strip after delimiters.
stripReplaceWith - String of characters to replace the stripped out characters with.
captionlast - If true, caption is located after input field.
trim - If true, trims (removes whitespace) from both ends of the string.
Returns:
A String caption for the input field at the specified fieldStartPos.

deshape

protected String deshape(String s)

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

getDefaultValues

public Properties getDefaultValues(int iPageNumber)
Description copied from interface: ICustomPropertySupplier
Returns this object's default property values.

Specified by:
getDefaultValues in interface ICustomPropertySupplier
Overrides:
getDefaultValues in class Component
Parameters:
iPageNumber - page for which to retrieve default properties
Returns:
object's default properties

getBlockScreenRegionString

public static String getBlockScreenRegionString(BlockScreenRegion bsr,
                                                HsrScreen hs,
                                                String strbreak)
Gets the rectangle defined in the block screen region as a string.

Parameters:
bsr - The region of the screen to retrieve.
hs - The host screen object.
strbreak - The row separator string to use.
Returns:
The rectangle defined in the block screen region as a string.

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)