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 FieldComponent

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

public class FieldComponent
extends Component
implements IContextDependent

The Field component is responsible for recognizing protected text and input fields. This component will recognize any selected host screen region and this component can be rendered using the Field widget.

There are no customizable settings for this component.

The recognize() methods of this component return an array of ComponentElement objects all of type:

Note: This component honors the region you specify. If the selected region cuts through an actual host screen field, only the part inside the selection will be rendered.


Field Summary
static String CLASS_NAME
           
static String PROPERTY_ENABLE_CHARACTER_LEVEL_ATTRIBUTES
           
 
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
FieldComponent(HsrScreen hostScreen)
          Constructs a new FieldComponent object.
 
Method Summary
protected  FieldComponentElement createEmptyFieldComponentElement(int startPos, int length)
          Returns an empty FieldComponentElement object.
protected  FieldComponentElement createPartialFieldComponentElement(FieldComponentElement fce, int startIndex, int length)
          Creates a new partial FieldComponentElement object based on the specific component element.
 Vector getCustomProperties(int iPageNumber, Properties properties, ResourceBundle bundle)
          Returns a list of this object's custom properties.
protected  ComponentElementList getFieldElementsInRow(int row, int startCol, int endCol)
          Returns a FieldRowComponentElement object which contains the set of fields recognized in the specified row.
 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 FieldRowComponentElement objects, each representing an entire screen row of fields and field segments.
 ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region, Properties settings)
          Not currently implemented.
protected  List splitAtIndices(FieldComponentElement fce, int[] changeIndices)
          Method that splits the specified FieldComponentElement object into separate parts.
 
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_ENABLE_CHARACTER_LEVEL_ATTRIBUTES

public static final String PROPERTY_ENABLE_CHARACTER_LEVEL_ATTRIBUTES
See Also:
Constant Field Values
Constructor Detail

FieldComponent

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

Parameters:
hostScreen -
Method Detail

recognize

public ComponentElement[] recognize(BlockScreenRegion region,
                                    Properties settings)
Returns an array of FieldRowComponentElement objects, each representing an entire screen row of fields and field segments.

The length of the returned array is equal to the number of rows in the specified region. Each FieldRowComponentElement is a set of FieldComponentElement objects.

Gaps between actual host screen fields are indicated as a protected, hidden FieldComponentElement objects.

Specified by:
recognize in class Component
Parameters:
region - rectangular region to search in
settings - recognition settings (not applicable)
Returns:
array of FieldRowComponentElement objects.

recognize

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

Specified by:
recognize in class Component

getFieldElementsInRow

protected ComponentElementList getFieldElementsInRow(int row,
                                                     int startCol,
                                                     int endCol)
Returns a FieldRowComponentElement object which contains the set of fields recognized in the specified row.

Parameters:
row - The (1-based) row to look for fields in.
startCol - The (1-based) column to begin looking for fields in.
endCol - The (1-based) column to stop looking for fields in (must be greater than the start column).
Returns:
A FieldRowComponentElement object which contains the set of fields recognized in the specified row.

createEmptyFieldComponentElement

protected FieldComponentElement createEmptyFieldComponentElement(int startPos,
                                                                 int length)
Returns an empty FieldComponentElement object. The field component element is marked as a hidden and protected, with a value of length number of spaces.

Parameters:
startPos - linear (1-based) starting position of the field represented by the component element object
length - length of the field represented by the component element object
Returns:
"empty" FieldComponentElement object.

splitAtIndices

protected List splitAtIndices(FieldComponentElement fce,
                              int[] changeIndices)
Method that splits the specified FieldComponentElement object into separate parts.

Parameters:
fce - The FieldComponentElement.
changeIndices - An array of change indices.
Returns:
A list of the separated parts of the specified FieldComponentElement object.

createPartialFieldComponentElement

protected FieldComponentElement createPartialFieldComponentElement(FieldComponentElement fce,
                                                                   int startIndex,
                                                                   int length)
Creates a new partial FieldComponentElement object based on the specific component element.

Parameters:
fce - The FieldComponentElement.
startIndex - The 0-based relative index (to the start of the specific FieldComponentElement object).
length - The length of the new component element object.
Returns:
A new partial FieldComponentElement object based on the specific component element.

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

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

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)