CICS® Transaction Gateway Programming Reference V3.1

com.ibm.ctg.epi
Class Field

java.lang.Object
  |
  +--com.ibm.ctg.epi.Field

public class Field
extends java.lang.Object
implements java.io.Serializable

This class represents a field in a 3270 screen and provides methods to query and set the contents and attributes of the field.

The field can be thought of as a piece of text with various attributes that define the way it is displayed on a 3270 terminal. A 3270 terminal would display the base attribute as a space, followed by the field text.

The base attribute byte is a bit field that encodes the field attributes. see the 3270 Datastream Programmers Reference for details.

See Also:
Serialized Form

Field Summary
static int alphanumeric
          alphanumeric field
static int black
          the color black
static int blinkHlt
          blink highlight
static int blue
          the color blue
static int cyan
          the color cyan
static int dark
          dark
static int darkblue
          the color dark blue
static int defaultColor
          default colour
static int defaultHlt
          default highlight
static int defaultTran
          default transparency
static int gray
          the color gray
static int green
          the color green
static int intense
          intense
static int intenseHlt
          intense highlight
static int isprotect
          protected field (no data entry)
static int modified
          modified field (will be flowed back to the server)
static int neutral
          neutral foreground color
static int neutralBGrnd
          neutral background colour
static int normal
          normal intensity
static int normalHlt
          normal highlight
static int numeric
          numeric field (non-numeric characters cannot be entered) This is not currently enforced
static int opaqueTran
          opaque transparency
static int orange
          the color orange
static int orTran
          OR transparency
static int paleCyan
          the color pale cyan
static int paleGreen
          the color pale green
static int pink
          the color pink
static int purple
          the color purple
static int red
          the color red
static int reverseHlt
          reverse highlight
static int underscoreHlt
          underscore highlight
static int unmodified
          unmodified field (does not need to be flowed back to the server)
static int unprotect
          unprotected field (text can be modified)
static int white
          the color white
static int xorTran
          XOR transparency
static int yellow
          the color yellow
 
Constructor Summary
(package private) Field(Screen screen, int pos)
          Constructs a field at the specified position in the screen buffer
 
Method Summary
 void appendText(java.lang.String append)
          Appends the given String to the field text
 int backgroundColor()
          Returns a constant indicating the background color of the field.
 char baseAttribute()
          Returns the 3270 base attribute of the field
 int dataTag()
          Returns a constant indicating whether or not the data in the field has been modified.
 int foregroundColor()
          Returns a constant indicating the foreground color of the field.
(package private)  boolean getAttribute()
          Returns a boolean indicating the presence of a field attribute
 byte[] getBytes()
          Returns the text currently in the field as a byte array
 int getColumn()
          Returns the column at which the field starts on the screen.
 int getPosition()
          Returns the position of the start of the field on the screen
 int getRow()
          Returns the row at which the field starts on the screen.
 java.lang.String getText()
          Return the contents of the field as a String
 int highlight()
          Returns a constant indicating which type of highlight is being used
 int inputProt()
          Returns a constant indicating whether or not the field is protected.
 int inputType()
          Returns a constant indicating the input data type for this field.
 int intensity()
          Returns a constant indicating the field intensity.
 int length()
          Returns the total length of the field
(package private)  void reset()
          Resets the field.
 void resetDataTag()
          Resets the modified data tag (MDT) to unmodified
(package private)  void setAttribute(boolean attribute)
          Sets whether there is a field attribute present
 void setBaseAttribute(char attr)
          Sets the 3270 base attribute
 void setBytes(int pos, byte[] newbytes, int length)
          Sets the byte array to the specified values starting at the specified buffer address.
 void setExtAttribute(char type, char value)
          Sets an extended 3270 attribute.
(package private)  void setMaxLength(int length)
          Sets the maximum text length.
 void setText(java.lang.String newtext)
          Set the contents of the field to the given String
 int textLength()
          Returns the number of characters in the field
 int transparency()
          Returns a constant indicating the background transparency of the field.
(package private)  void updateBytes()
          Converts String representation to bytes
(package private)  void updateString()
          Converts byte representation to String
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultHlt

public static final int defaultHlt
default highlight

normalHlt

public static final int normalHlt
normal highlight

blinkHlt

public static final int blinkHlt
blink highlight

reverseHlt

public static final int reverseHlt
reverse highlight

underscoreHlt

public static final int underscoreHlt
underscore highlight

intenseHlt

public static final int intenseHlt
intense highlight

defaultColor

public static final int defaultColor
default colour

neutralBGrnd

public static final int neutralBGrnd
neutral background colour

blue

public static final int blue
the color blue

red

public static final int red
the color red

pink

public static final int pink
the color pink

green

public static final int green
the color green

cyan

public static final int cyan
the color cyan

yellow

public static final int yellow
the color yellow

neutral

public static final int neutral
neutral foreground color

black

public static final int black
the color black

darkblue

public static final int darkblue
the color dark blue

orange

public static final int orange
the color orange

purple

public static final int purple
the color purple

paleGreen

public static final int paleGreen
the color pale green

paleCyan

public static final int paleCyan
the color pale cyan

gray

public static final int gray
the color gray

white

public static final int white
the color white

defaultTran

public static final int defaultTran
default transparency

orTran

public static final int orTran
OR transparency

xorTran

public static final int xorTran
XOR transparency

opaqueTran

public static final int opaqueTran
opaque transparency

isprotect

public static final int isprotect
protected field (no data entry)

unprotect

public static final int unprotect
unprotected field (text can be modified)

alphanumeric

public static final int alphanumeric
alphanumeric field

numeric

public static final int numeric
numeric field (non-numeric characters cannot be entered) This is not currently enforced

normal

public static final int normal
normal intensity

intense

public static final int intense
intense

dark

public static final int dark
dark

unmodified

public static final int unmodified
unmodified field (does not need to be flowed back to the server)

modified

public static final int modified
modified field (will be flowed back to the server)
Constructor Detail

Field

Field(Screen screen,
      int pos)
Constructs a field at the specified position in the screen buffer
Parameters:
screen - the Screen that contains the field
pos - the buffer position of the field
Method Detail

setMaxLength

void setMaxLength(int length)
Sets the maximum text length. This is the number of bytes to the start of the next field, or the end of the screen.
Parameters:
length - the maximum length

getAttribute

boolean getAttribute()
Returns a boolean indicating the presence of a field attribute
Returns:
true if an attribute is present

setAttribute

void setAttribute(boolean attribute)
Sets whether there is a field attribute present
Parameters:
attribute - true or false

getPosition

public int getPosition()
Returns the position of the start of the field on the screen
Returns:
the position

getRow

public int getRow()
Returns the row at which the field starts on the screen.
Returns:
the row number

getColumn

public int getColumn()
Returns the column at which the field starts on the screen.
Returns:
the column number

length

public int length()
Returns the total length of the field
Returns:
the length

baseAttribute

public char baseAttribute()
Returns the 3270 base attribute of the field
Returns:
the attribute as a character

inputProt

public int inputProt()
Returns a constant indicating whether or not the field is protected.
Returns:
isprotect or unprotect

inputType

public int inputType()
Returns a constant indicating the input data type for this field.
Returns:
numeric or alphanumeric

intensity

public int intensity()
Returns a constant indicating the field intensity.
Returns:
intense, dark or normal

dataTag

public int dataTag()
Returns a constant indicating whether or not the data in the field has been modified.
Returns:
modified or unmodified

highlight

public int highlight()
Returns a constant indicating which type of highlight is being used
Returns:
the highlight

transparency

public int transparency()
Returns a constant indicating the background transparency of the field.
Returns:
the transparency

foregroundColor

public int foregroundColor()
Returns a constant indicating the foreground color of the field.
Returns:
the colour

backgroundColor

public int backgroundColor()
Returns a constant indicating the background color of the field.
Returns:
the colour

setBaseAttribute

public void setBaseAttribute(char attr)
Sets the 3270 base attribute
Parameters:
attr - the attribute

resetDataTag

public void resetDataTag()
Resets the modified data tag (MDT) to unmodified

setExtAttribute

public void setExtAttribute(char type,
                            char value)
                     throws EPIException
Sets an extended 3270 attribute.
Parameters:
type - the attribute type
value - the attribute value
Throws:
EPIException - if input parameters are invalid

appendText

public void appendText(java.lang.String append)
                throws java.io.UnsupportedEncodingException
Appends the given String to the field text
Parameters:
append - the text to add
Throws:
UnsupportedEncodingException - if the field text cannot be converted to characters

reset

void reset()
Resets the field. Used to implement EUA order.

setBytes

public void setBytes(int pos,
                     byte[] newbytes,
                     int length)
              throws java.io.UnsupportedEncodingException
Sets the byte array to the specified values starting at the specified buffer address.
Parameters:
pos - the buffer address
newbytes - the bytes
length - the number of bytes
Throws:
UnsupportedEncodingException - if the field text cannot be converted to bytes

textLength

public int textLength()
Returns the number of characters in the field
Returns:
the text length

setText

public void setText(java.lang.String newtext)
Set the contents of the field to the given String
Parameters:
newtext - a String

getText

public java.lang.String getText()
                         throws java.io.UnsupportedEncodingException
Return the contents of the field as a String
Returns:
the field text
Throws:
UnsupportedEncodingException - if the field text cannot be converted to characters

getBytes

public byte[] getBytes()
                throws java.io.UnsupportedEncodingException
Returns the text currently in the field as a byte array
Returns:
the text
Throws:
UnsupportedEncodingException - if the field text cannot be converted to bytes

updateString

void updateString()
            throws java.io.UnsupportedEncodingException
Converts byte representation to String
Throws:
UnsupportedEncodingException - if the field text cannot be converted to a String

updateBytes

void updateBytes()
           throws java.io.UnsupportedEncodingException
Converts String representation to bytes
Throws:
UnsupportedEncodingException - if the field text cannot be converted to bytes

© Copyright IBM Corp. 1994, 1999