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.hsr.screen
Class HsrAttributes

java.lang.Object
  extended by com.ibm.hsr.screen.HsrAttributes

public class HsrAttributes
extends Object

HsrAttributes is the base class for storing attributes of a particular HsrScreenField object. The HsrAttributes object stores information about the field, such as if the field is protected, hidden, or high-intensity. A consumer can also store and retrieve custom attributes in the HsrAttributes object using the setAttribute() and getAttribute() methods.

Please Note: the HsrAttributes class is only a basic class that provides a framework for defining the attributes necessary to the HSR component. This class should be extended by the consumer, in order to provide useful functionality for each of the getter/setter functions. For example, if a consumer's HsrScreen interface implements the IBM Host Access Client Library, the HsrAttributes function "getForegroundColor(position)" could query the Color Plane of a particular position on the consumer's ECLPS object to retrieve its foreground color.


Field Summary
static String ATTR_3270_FIELD
          Attribute for determining whether a field is from a 3270 screen
static String ATTR_5250_FIELD
          Attribute for determining whether a field is from a 5250 screen
static String ATTR_ALPHA_NUMERIC
          Attribute for determining whether a field is alpha-numeric
static String ATTR_BLINK
          Attribute for determining whether a field is blinking
static String ATTR_DBCS_ONLY
          Attribute for determining whether or not the field is DBCS-only
static String ATTR_DBCS_OPEN
          Attribute for determining whether or not the field is DBCS-open
static String ATTR_DISPLAY
          Attribute for determining whether or not the field is displayable.
static String ATTR_HIDDEN
          Attribute for determining whether a field is a hidden field
static String ATTR_HIGH_INTENSITY
          Attribute for determining whether or not the field is high-intensity.
static String ATTR_MODIFIED
          Attribute for determining whether the field has been modified.
static String ATTR_NUMERIC
          Attribute for determining whether the field is numeric-only.
static String ATTR_PEN_DETECTABLE
          Attribute for determining whether the field is pen-detectable.
static String ATTR_PROTECTED
          Attribute for determining whether the field is protected.
static String ATTR_REVERSE_VIDEO
          Attribute for determining whether a field is reverse-video
static String ATTR_RIGHT_TO_LEFT
          Attribute for determining whether a field is right-to-left (Bidi-only)
static String ATTR_UNDERLINE
          Attribute for determining whether a field is underline
static String ATTR_UNICODE
          Attribute for determining whether a field is Unicode-formatted.
protected  Hashtable attributeList
          Hashtable to hold all of the attributes related to a field.
 
Constructor Summary
HsrAttributes()
          Construct an instance of an HsrAttributes object.
 
Method Summary
 Object getAttribute(Object attributeName)
          Get an attribute in the HsrAttribute object.
 Hashtable getAttributes()
          Get all attributes in the HsrAttribute object.
 int getBackgroundColor()
          Gets the background color of a field.
 int getBackgroundColor(int fieldPosition)
          Gets the background color of a field, at a specific position in the field.
 int getForegroundColor()
           Gets the foreground color of a field, where the color value ranges from 0-15, as in the IBM Host Access Client Library.
 int getForegroundColor(int fieldPosition)
           Gets the foreground color of a field, at a specific position in the field, where the color value ranges from 0-15, as in the IBM Host Access Client Library.
 boolean is3270Field()
          Returns whether the field is from a 3270 screen.
 boolean is5250Field()
          Returns whether the field is from a 5250 screen.
 boolean isAlphaNumeric()
          Returns whether the field is alpha-numeric.
 boolean isBlink()
          Returns whether the field is blinking.
 boolean isDbcsOnly()
          Returns whether the field is DBCS-only.
 boolean isDbcsOpen()
          Returns whether the field is DBCS-open.
 boolean isDisplay()
          Returns whether the field is displayable.
 boolean isEmpty()
          Returns whether the attribute list is empty or not.
 boolean isHidden()
          Returns whether the field is hidden.
 boolean isHighIntensity()
          Returns whether the field is highIntensity.
 boolean isModified()
          Returns whether the field was modified.
 boolean isNumeric()
          Returns whether the field is numeric-only.
 boolean isPenDetectable()
          Returns whether the field is penDetectable.
 boolean isProtected()
          Returns whether the field is protected.
 boolean isReverseVideo()
          Returns whether the field is reverse video.
 boolean isRightToLeftField()
          Returns whether the field is right-to-left (Bidi-only).
 boolean isUnderline()
          Returns whether the field is underlined.
 boolean isUnicode()
          Returns whether the field is unicode.
 void set3270Field(boolean is3270Field)
          Set whether the field is a 3270-specific field.
 void set5250Field(boolean is5250Field)
          Set whether the field is a 5250-specific field.
 void setAlphaNumeric(boolean isAlphaNumeric)
          Set whether the field is alpha-numeric.
 void setAttribute(Object attrName, Object attrValue)
          Set an attribute in the HsrAttributes object.
 void setBlink(boolean isBlink)
          Set whether the field is blink.
 void setDbcsOnly(boolean isDBCSonly)
          Set whether the field is DBCS-only.
 void setDbcsOpen(boolean isDBCSopen)
          Set whether the field is DBCS-open.
 void setDisplay(boolean display)
          Set whether the field is displayed.
 void setHidden(boolean isHidden)
          Set whether the field is hidden.
 void setHighIntensity(boolean highIntensity)
          Set whether the field is high-intensity.
 void setModified(boolean modified)
          Set whether the field is modified.
 void setNumeric(boolean numeric)
          Set whether the field is numeric.
 void setPenDetectable(boolean penDetectable)
          Set whether the field is pen-detectable.
 void setProtected(boolean protectedField)
          Set whether the field is protected.
 void setReverseVideo(boolean isReverseVideo)
          Set whether the field is reverse-video.
 void setRightToLeft(boolean isRightToLeft)
          Set whether the field is Bidi right-to-left.
 void setUnderline(boolean isUnderline)
          Set whether the field is underline.
 void setUnicode(boolean unicode)
          Set whether the field is unicode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_3270_FIELD

public static final String ATTR_3270_FIELD
Attribute for determining whether a field is from a 3270 screen

See Also:
Constant Field Values

ATTR_5250_FIELD

public static final String ATTR_5250_FIELD
Attribute for determining whether a field is from a 5250 screen

See Also:
Constant Field Values

ATTR_ALPHA_NUMERIC

public static final String ATTR_ALPHA_NUMERIC
Attribute for determining whether a field is alpha-numeric

See Also:
Constant Field Values

ATTR_BLINK

public static final String ATTR_BLINK
Attribute for determining whether a field is blinking

See Also:
Constant Field Values

ATTR_DBCS_ONLY

public static final String ATTR_DBCS_ONLY
Attribute for determining whether or not the field is DBCS-only

See Also:
Constant Field Values

ATTR_DBCS_OPEN

public static final String ATTR_DBCS_OPEN
Attribute for determining whether or not the field is DBCS-open

See Also:
Constant Field Values

ATTR_DISPLAY

public static final String ATTR_DISPLAY
Attribute for determining whether or not the field is displayable.

See Also:
Constant Field Values

ATTR_HIDDEN

public static final String ATTR_HIDDEN
Attribute for determining whether a field is a hidden field

See Also:
Constant Field Values

ATTR_HIGH_INTENSITY

public static final String ATTR_HIGH_INTENSITY
Attribute for determining whether or not the field is high-intensity.

See Also:
Constant Field Values

ATTR_MODIFIED

public static final String ATTR_MODIFIED
Attribute for determining whether the field has been modified.

See Also:
Constant Field Values

ATTR_NUMERIC

public static final String ATTR_NUMERIC
Attribute for determining whether the field is numeric-only.

See Also:
Constant Field Values

ATTR_PEN_DETECTABLE

public static final String ATTR_PEN_DETECTABLE
Attribute for determining whether the field is pen-detectable.

See Also:
Constant Field Values

ATTR_PROTECTED

public static final String ATTR_PROTECTED
Attribute for determining whether the field is protected.

See Also:
Constant Field Values

ATTR_REVERSE_VIDEO

public static final String ATTR_REVERSE_VIDEO
Attribute for determining whether a field is reverse-video

See Also:
Constant Field Values

ATTR_RIGHT_TO_LEFT

public static final String ATTR_RIGHT_TO_LEFT
Attribute for determining whether a field is right-to-left (Bidi-only)

See Also:
Constant Field Values

ATTR_UNDERLINE

public static final String ATTR_UNDERLINE
Attribute for determining whether a field is underline

See Also:
Constant Field Values

ATTR_UNICODE

public static final String ATTR_UNICODE
Attribute for determining whether a field is Unicode-formatted.

See Also:
Constant Field Values

attributeList

protected Hashtable attributeList
Hashtable to hold all of the attributes related to a field. Each attribute should be stored in a name/value pair for easy retrieval. No assumptions are made about the type of the attribute returned.

Constructor Detail

HsrAttributes

public HsrAttributes()
Construct an instance of an HsrAttributes object.

Method Detail

getAttribute

public Object getAttribute(Object attributeName)
Get an attribute in the HsrAttribute object.

Parameters:
attributeName - The attribute name.
Returns:
Value of the attribute or null if attribute not found.

getAttributes

public Hashtable getAttributes()
Get all attributes in the HsrAttribute object.

Returns:
Hashtable of all attributes.

getBackgroundColor

public int getBackgroundColor()
Gets the background color of a field.

Note: this function should be overridden by the consuming product's extension of HsrAttributes, as it currently only returns an int value "0" for default blank color.

Returns:
The field background color for a specific position in the field as an integer value and is a color range from 0-7, as seen in the IBM Host Access Client Library.

getBackgroundColor

public int getBackgroundColor(int fieldPosition)
Gets the background color of a field, at a specific position in the field.

Note: this function should be overridden by the consuming product's extension of HsrAttributes, as it currently only returns an int value "0" for default blank color.

Parameters:
fieldPosition - Position of the character in the field for which to retrieve background color information.
Returns:
The field background color for a specific position in the field as an integer value and is a color range from 0-7, as seen in the IBM Host Access Client Library.

getForegroundColor

public int getForegroundColor()

Gets the foreground color of a field, where the color value ranges from 0-15, as in the IBM Host Access Client Library.

NOTE: this function should be overridden by the consuming product's extension of HsrAttributes, as it currently only returns an int value "2" for default green.

Returns:
The field foreground color for the field as an integer value.

getForegroundColor

public int getForegroundColor(int fieldPosition)

Gets the foreground color of a field, at a specific position in the field, where the color value ranges from 0-15, as in the IBM Host Access Client Library.

NOTE: this function should be overridden by the consuming product's extension of HsrAttributes, as it currently only returns an int value "2" for default green.

Parameters:
fieldPosition - Postition of the field from which to retrieve color information.
Returns:
The field foreground color for a specific position in the field as an integer value.

is3270Field

public boolean is3270Field()
Returns whether the field is from a 3270 screen. If no attribute is found, returns false.

Returns:
Whether the field is from a 3270 screen or false if no attribute is found.

is5250Field

public boolean is5250Field()
Returns whether the field is from a 5250 screen. If no attribute is found, returns false.

Returns:
Whether the field is from a 5250 screen or false if no attribute is found.

isAlphaNumeric

public boolean isAlphaNumeric()
Returns whether the field is alpha-numeric. If no attribute is found, returns false.

Returns:
Whether the field is alpha-numeric or false if no attribute is found.

isBlink

public boolean isBlink()
Returns whether the field is blinking. If no display attribute is found, returns false.

Returns:
Whether the field is blinking or false if no attribute is found.

isDbcsOnly

public boolean isDbcsOnly()
Returns whether the field is DBCS-only. If no DBCS-only attribute is found, returns false. For 3270 screen, the field is a G-field (Display DBCS characters directly without Shift-in and Shift-out). For 5250 screen, the field is a J-field (Display DBCS characters directly with Shift-in and Shift-out).

Returns:
Whether the field is DBCS-only or false if no attribute is found.

isDbcsOpen

public boolean isDbcsOpen()
Returns whether the field is DBCS-open. If no DBCS-open attribute is found, returns false. For 3270 screen, the field is also called DBCS-mix field.

Returns:
Whether the field is DBCS-open or false if no attribute is found.

isDisplay

public boolean isDisplay()
Returns whether the field is displayable. If no display attribute is found, returns false.

Returns:
Whether the field is displayable or false if no attribute is found.

isEmpty

public boolean isEmpty()
Returns whether the attribute list is empty or not.

Returns:
Whether the attribute list is empty or not.

isHidden

public boolean isHidden()
Returns whether the field is hidden. If no display attribute is found, returns false.

Returns:
Whether the field is hidden or false if no attribute is found.

isHighIntensity

public boolean isHighIntensity()
Returns whether the field is highIntensity. If no intensity attribute is found, returns false.

Returns:
Whether the field is highIntensity or false if no attribute is found.

isModified

public boolean isModified()
Returns whether the field was modified. If no modified attribute is found, returns false.

Returns:
Whether the field was modified or false if no attribute is found.

isNumeric

public boolean isNumeric()
Returns whether the field is numeric-only. If no numeric attribute is found, returns false.

Returns:
Whether the field is numeric-only or false if no attribute is found.

isPenDetectable

public boolean isPenDetectable()
Returns whether the field is penDetectable. If no pen-detectable attribute is found, returns false.

Returns:
Whether the field is penDetectable or false if no attribute is found.

isProtected

public boolean isProtected()
Returns whether the field is protected. If no protected attribute is found, returns false.

Returns:
Whether the field is protected or false if no attribute is found.

isReverseVideo

public boolean isReverseVideo()
Returns whether the field is reverse video. If no display attribute is found, returns false.

Returns:
Whether the field is reverse video or false if no attribute is found.

isRightToLeftField

public boolean isRightToLeftField()
Returns whether the field is right-to-left (Bidi-only). If no display attribute is found, returns false.

Returns:
Whether the field is right-to-left (Bidi-only or false if no attribute is found.

isUnderline

public boolean isUnderline()
Returns whether the field is underlined. If no display attribute is found, returns false.

Returns:
Whether the field is underlined or false if no attribute is found.

isUnicode

public boolean isUnicode()
Returns whether the field is unicode. If no unicode attribute is found, returns false.

Returns:
Whether the field is unicode or false if no attribute is found.

set3270Field

public void set3270Field(boolean is3270Field)
Set whether the field is a 3270-specific field.

Parameters:
is3270Field - A boolean true or false.

set5250Field

public void set5250Field(boolean is5250Field)
Set whether the field is a 5250-specific field.

Parameters:
is5250Field - A boolean true or false.

setAlphaNumeric

public void setAlphaNumeric(boolean isAlphaNumeric)
Set whether the field is alpha-numeric.

Parameters:
isAlphaNumeric - A boolean true or false.

setAttribute

public void setAttribute(Object attrName,
                         Object attrValue)
Set an attribute in the HsrAttributes object.

Parameters:
attrName - Name of attribute.
attrValue - Value of attribue.

setBlink

public void setBlink(boolean isBlink)
Set whether the field is blink.

Parameters:
isBlink - A boolean true or false.

setDbcsOnly

public void setDbcsOnly(boolean isDBCSonly)
Set whether the field is DBCS-only.

Parameters:
isDBCSonly - A boolean true or false.

setDbcsOpen

public void setDbcsOpen(boolean isDBCSopen)
Set whether the field is DBCS-open.

Parameters:
isDBCSopen - A boolean true or false.

setDisplay

public void setDisplay(boolean display)
Set whether the field is displayed.

Parameters:
display - A boolean true or false.

setHidden

public void setHidden(boolean isHidden)
Set whether the field is hidden.

Parameters:
isHidden - A boolean true or false.

setHighIntensity

public void setHighIntensity(boolean highIntensity)
Set whether the field is high-intensity.

Parameters:
highIntensity - A boolean true or false.

setModified

public void setModified(boolean modified)
Set whether the field is modified.

Parameters:
modified - A boolean true or false.

setNumeric

public void setNumeric(boolean numeric)
Set whether the field is numeric.

Parameters:
numeric - A boolean true or false.

setPenDetectable

public void setPenDetectable(boolean penDetectable)
Set whether the field is pen-detectable.

Parameters:
penDetectable - A boolean true or false.

setProtected

public void setProtected(boolean protectedField)
Set whether the field is protected.

Parameters:
protectedField - A boolean true or false.

setReverseVideo

public void setReverseVideo(boolean isReverseVideo)
Set whether the field is reverse-video.

Parameters:
isReverseVideo - A boolean true or false.

setRightToLeft

public void setRightToLeft(boolean isRightToLeft)
Set whether the field is Bidi right-to-left.

Parameters:
isRightToLeft - A boolean true or false.

setUnderline

public void setUnderline(boolean isUnderline)
Set whether the field is underline.

Parameters:
isUnderline - A boolean true or false.

setUnicode

public void setUnicode(boolean unicode)
Set whether the field is unicode.

Parameters:
unicode - A boolean true or false.

HATS 7.5.1 (201005110649)