com.ibm.ctg.epi

Class Field

  • java.lang.Object
    • com.ibm.ctg.epi.Field
  • All Implemented Interfaces:
    java.io.Serializable


    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.

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      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 which does not allow 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).
      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 allowing text to be modified.
      static int white
      The color white.
      static int xorTran
      XOR transparency.
      static int yellow
      The color yellow.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      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.
      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()
      Returns the contents of the field as a String.
      boolean hasAttribute()
      Returns a boolean indicating the presence of a field attribute.
      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.
      void resetDataTag()
      Resets the Modified Data Tag (MDT) to unmodified.
      void setBaseAttribute(char attr)
      Sets the 3270 base attribute.
      void setBytes(int pos, byte[] newbytes, int length)
      Deprecated. 
      This Method is not recommended for use as extreme care is required To ensure that the bytes are in the correct encoding and the buffer address and length are exactly correct. You should use setText instead to ensure correct field manipulation.
      void setExtAttribute(char type, char value)
      Sets an extended 3270 attribute.
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • hasAttribute

        public boolean hasAttribute()
        Returns a boolean indicating the presence of a field attribute.
        Returns:
        true if an attribute is present
      • 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
      • setBytes

        @Deprecated
        public void setBytes(int pos,
                               byte[] newbytes,
                               int length)
                      throws java.io.UnsupportedEncodingException
        Deprecated. This Method is not recommended for use as extreme care is required To ensure that the bytes are in the correct encoding and the buffer address and length are exactly correct. You should use setText instead to ensure correct field manipulation.
        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
        java.io.UnsupportedEncodingException
      • 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
        Returns 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
©Copyright IBM Corp. 1994, 2013
Legal