public class Field
extends java.lang.Object
implements java.io.Serializable
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.
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.
|
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.
|
public static final int defaultHlt
public static final int normalHlt
public static final int blinkHlt
public static final int reverseHlt
public static final int underscoreHlt
public static final int intenseHlt
public static final int defaultColor
public static final int neutralBGrnd
public static final int blue
public static final int red
public static final int pink
public static final int green
public static final int cyan
public static final int yellow
public static final int neutral
public static final int black
public static final int darkblue
public static final int orange
public static final int purple
public static final int paleGreen
public static final int paleCyan
public static final int gray
public static final int white
public static final int defaultTran
public static final int orTran
public static final int xorTran
public static final int opaqueTran
public static final int isprotect
public static final int unprotect
public static final int alphanumeric
public static final int numeric
public static final int normal
public static final int intense
public static final int dark
public static final int unmodified
public static final int modified
public boolean hasAttribute()
public int getPosition()
public int getRow()
public int getColumn()
public int length()
public char baseAttribute()
public int inputProt()
public int inputType()
public int intensity()
public int dataTag()
public int highlight()
public int transparency()
public int foregroundColor()
public int backgroundColor()
public void setBaseAttribute(char attr)
attr
- the attributepublic void resetDataTag()
public void setExtAttribute(char type, char value) throws EPIException
type
- the attribute typevalue
- the attribute valueEPIException
- if input parameters are invalidpublic void appendText(java.lang.String append) throws java.io.UnsupportedEncodingException
append
- the text to addUnsupportedEncodingException
- if the field text cannot be converted to characters@Deprecated public void setBytes(int pos, byte[] newbytes, int length) throws java.io.UnsupportedEncodingException
pos
- the buffer addressnewbytes
- the byteslength
- the number of bytesUnsupportedEncodingException
- if the field text cannot be converted to bytesjava.io.UnsupportedEncodingException
public int textLength()
public void setText(java.lang.String newtext)
newtext
- a Stringpublic java.lang.String getText() throws java.io.UnsupportedEncodingException
UnsupportedEncodingException
- if the field text cannot be converted to characterspublic byte[] getBytes() throws java.io.UnsupportedEncodingException
UnsupportedEncodingException
- if the field text cannot be converted to bytes