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 InputComponent

java.lang.Object
  extended by com.ibm.hats.transform.components.Component
      extended by com.ibm.hats.transform.components.InputComponent
All Implemented Interfaces:
IContextDependent, ICustomPropertySupplier
Direct Known Subclasses:
CommandLineComponent, InputWithHintsComponent

public class InputComponent
extends Component
implements IContextDependent

The Input component is for recognizing input fields (non-protected fields). This component, besides recognizing input fields, can also extract the field's accompanying caption. To find the field's caption, this component looks for protected text directly preceding the input field (on the same row) first. If the algorithm cannot find a caption, it will look directly above the field for protected text.

A recognized command line 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
clipInputFieldsIf true, only the part of the input field inside of the selected region is recognized and rendered. If false, if any part of an input field is inside the selected region, the entire input field is recognized and rendered. This setting is useful if you need to break a large host screen input field into multiple, smaller Web page input fields.booleantrue
extractCaptionsIf true, a caption for the recognized input field is extracted (see the description above for more information on this algorithm). This extracted caption can be used by the widget.booleantrue
clipCaptionsIf true, only the caption text in the selected region is rendered. If false, the end no such clipping occurs.booleanfalse
stripCaptionsIf true, the end of the caption is stripped after (and including) the first occurrence of any value specified in the ?Strip after? setting. This setting is useful for cleaning up extracted captions.booleantrue
stripAfterDelimitersThe string (or set of strings) that is used to strip the extracted caption. For example, if the extracted caption is ?Command ==>? and the value for this setting is ?=?, everything after (and including) the first ?=? is stripped off.String:|-|.
stripReplaceWithThe string that must immediately follow the description.String:
trimCaptionsIf true, white space (spaces, tabs, etc) is removed from both ends of the extracted (and stripped) caption.booleantrue


Field Summary
protected  boolean BIDIInputFieldwithHints
           
static String CLASS_NAME
           
static Properties defaults
          Properties object that contains the default values for each setting of this component.
static String PROPERTY_CLIP_CAPTIONS
          clipCaptions (see properties table above)
static String PROPERTY_CLIP_INPUT_FIELDS
          clipInputFields (see properties table above)
static String PROPERTY_EXTRACT_CAPTIONS
          extractCaptions (see properties table above)
static String PROPERTY_STRIP_AFTER_DELIMITERS
          stripAfterDelimiters (see properties table above)
static String PROPERTY_STRIP_CAPTIONS
          stripCaptions (see properties table above)
static String PROPERTY_STRIP_REPLACE_WITH
          stripReplaceWith (see properties table above)
static String PROPERTY_TRIM_CAPTIONS
          trimCaptions (see properties table above)
protected  boolean reverseComponent
           
 
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
InputComponent(HsrScreen hostScreen)
          Constructs a new InputComponent object.
 
Method Summary
 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, BlockScreenRegion selectedRegion, boolean strip, String[] stripAfterDelimiters, String stripReplaceWith, boolean trim)
          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 input field (or partial input field) that was found in the specified region.
 ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region, Properties settings)
          Not implemented yet.
 
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
clipInputFields (see properties table above)

See Also:
Constant Field Values

PROPERTY_CLIP_CAPTIONS

public static final String PROPERTY_CLIP_CAPTIONS
clipCaptions (see properties table above)

See Also:
Constant Field Values

PROPERTY_EXTRACT_CAPTIONS

public static final String PROPERTY_EXTRACT_CAPTIONS
extractCaptions (see properties table above)

See Also:
Constant Field Values

PROPERTY_STRIP_CAPTIONS

public static final String PROPERTY_STRIP_CAPTIONS
stripCaptions (see properties table above)

See Also:
Constant Field Values

PROPERTY_STRIP_AFTER_DELIMITERS

public static final String PROPERTY_STRIP_AFTER_DELIMITERS
stripAfterDelimiters (see properties table above)

See Also:
Constant Field Values

PROPERTY_STRIP_REPLACE_WITH

public static final String PROPERTY_STRIP_REPLACE_WITH
stripReplaceWith (see properties table above)

See Also:
Constant Field Values

PROPERTY_TRIM_CAPTIONS

public static final String PROPERTY_TRIM_CAPTIONS
trimCaptions (see properties table above)

See Also:
Constant Field Values

defaults

public static Properties defaults
Properties object that contains the default values for each setting of this component.


reverseComponent

protected boolean reverseComponent

BIDIInputFieldwithHints

protected boolean BIDIInputFieldwithHints
Constructor Detail

InputComponent

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

Parameters:
hostScreen -
Method Detail

recognize

public ComponentElement[] recognize(BlockScreenRegion region,
                                    Properties settings)
Returns an array of InputComponentElement objects representing each input field (or partial input field) that was found in the specified region.

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)

recognize

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

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,
                              BlockScreenRegion selectedRegion,
                              boolean strip,
                              String[] stripAfterDelimiters,
                              String stripReplaceWith,
                              boolean trim)
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.
selectedRegion - A BlockScreenRegion to clip caption, or null if not clipping to selectedRegion.
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.
trim - If true, trims (removes whitespace) from both ends of the string.
Returns:
A String caption for the input field at the specified fieldStartPos.

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

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)