Interface Field


  • public interface Field
    Represents a field instance in the presentation space where the host types or the given screen supports fields. Not all presentation space instances will support fields.
    • Method Detail

      • getAttributes

        EnumSet<Attribute> getAttributes()
        Returns the set of attributes specified for this field instance.
        Returns:
        the set of attributes specified for this field instance.
      • getBackgroundColor

        Color getBackgroundColor()
        Returns the background color specified for this field instance
        Returns:
        the background color specified for this field
      • getForegroundColor

        Color getForegroundColor()
        Returns the foreground color specified for this field instance
        Returns:
        the foreground color specified for this field
      • getStart

        Position getStart()
        Returns the starting position of the field, which is the position of the first character of the field. For 3270 and 5250, which use a data cell instance to store field level attributes, the attribute space is not considered the start position.
        Returns:
        the starting position of the field.
      • getEnd

        Position getEnd()
        Returns the ending position of the field, which is the position in the presentation space containing the last character of the field.
        Returns:
        the ending position of the field.
      • getLength

        int getLength()
        Returns the length of the field. For host types that use a character position to store field attributes, the field length does not include the field attribute position.
        Returns:
        the length of the field.
      • getText

        String getText()
        Returns the text from the field.
        Returns:
        the field text
      • getDataCells

        List<DataCell> getDataCells()
        Returns a list of data cell instances that are included in the field.
        Returns:
        a list of data cell instances that are included in the field
      • setText

        void setText​(String text)
              throws PresentationSpaceException
        Sets the field text. For certain host types like VT the text is transmitted to the host right away whereas, in other host types, the text is not transmitted to the host until an aid key is invoked. If the text is shorter than the field, the text is placed in the host field, and the remainder of the field is cleared. If the text is longer than the host field, as much text as fits is placed in the field.
        Parameters:
        text - the text to be set on the field.
        Throws:
        ProtectedFieldException - if the field is protected.
        PresentationSpaceException - if an error occurs
      • getPresentationSpace

        PresentationSpace getPresentationSpace()
        Returns the PresentationSpace instance which contains this field
        Returns:
        the PresentationSpace instance which contains this field