public abstract class DisplayFormat.Presentation
extends java.lang.Object
toScreenValue()
call. Other methods are mainly for FillIn.Modifier and Type | Field and Description |
---|---|
protected int |
presCursorPos
Cursor's position.
|
protected boolean |
presInsertMode
Insert mode (
true - insert, false -
overwrite). |
private boolean |
presLastCharEntered
Is the last format's character entered.
|
Constructor and Description |
---|
Presentation()
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Performs the necessary initialization for a widget which is
activated by a focus change (using a tab).
|
abstract void |
checkFormat()
Checks format rules.
|
abstract boolean |
deleteBack()
Erases one symbol before the cursor position.
|
abstract boolean |
deleteCurrent()
Erases one symbol in the cursor position.
|
abstract boolean |
finishEdit()
Indicates completion of an edit.
|
int |
getCursorPos()
Returns the cursor's position.
|
int |
getInitialCursorPos()
Get initial cursor position which will be set during activation.
|
boolean |
getInsertMode()
Returns the insert mode state.
|
int |
getLastPos()
Returns the last valid cursor position in the current data.
|
abstract boolean |
input(char ch)
Inputs character.
|
abstract boolean |
isFixedFont()
Determine if this format must use the DEFAULT-FIXED-FONT, if no font is specified.
|
boolean |
isFixedNumeric()
Detects if the numeric format is comprised of digits that always
output (like "-99,999").
|
boolean |
isLastCharEntered()
Returns is the last format's character entered.
|
boolean |
isNegative()
Returns the sign state of the numeric value.
|
boolean |
isOptionalLeftSign()
Detects if the numeric sign formatting character exists in the
format and if it is optional.
|
abstract boolean |
isUnknown()
Returns if the presentation currently represents the
unknown value . |
abstract boolean |
moveCursorBegin()
Moves cursor to the beginning of the field.
|
abstract boolean |
moveCursorEnd()
Moves cursor to the end of the field.
|
abstract boolean |
moveCursorLeft()
Moves cursor one character to the left.
|
abstract boolean |
moveCursorRight()
Moves cursor one character to the right.
|
void |
setCursorPos(int cursorPos)
Sets the new cursor's position.
|
void |
setInsertMode(boolean insertMode)
Changes the insert mode state.
|
void |
setLastCharEntered(boolean lastCharEntered)
Sets is the last format's character entered.
|
abstract java.lang.String |
toScreenValue()
Formats the data as a string that is ready for display.
|
java.lang.String |
toScreenValue(boolean edit)
Formats the data as a string that is ready for display.
|
abstract void |
toVar(BaseDataType var)
Instantiates a variable that is equivalent to the presentation's
internal representation.
|
ErrorManager.ErrorEntry[] |
validateFormat()
Validate representation according to format rules and return error
message if there is an error.
|
protected int presCursorPos
insert()
,deleteBack()
etc.) methods.
Default value is 0
.protected boolean presInsertMode
true
- insert, false
-
overwrite). May be changed as from input methods as directly from a
widget. Default value is false
.private boolean presLastCharEntered
input()
method and is necessary to implement
AUTO-RETURN FillIn behaviour.public int getLastPos()
public int getCursorPos()
public void setCursorPos(int cursorPos)
cursorPos
- The new cursor's position.public boolean isNegative()
false
.public boolean isOptionalLeftSign()
false
.public boolean isFixedNumeric()
false
.public boolean getInsertMode()
false
- overwrite mode,
true
- insert mode.
public void setInsertMode(boolean insertMode)
insertMode
- New state.
false
- overwrite mode,
true
- insert mode.
public boolean isLastCharEntered()
true
if the last format's character entered.public void setLastCharEntered(boolean lastCharEntered)
lastCharEntered
- Is the last format's character entered.public java.lang.String toScreenValue(boolean edit)
edit
- true
if the screen value is being generated
for interactive editing purposes.public void activate()
public int getInitialCursorPos()
public abstract void checkFormat() throws DisplayFormatCheckException
DisplayFormatCheckException
- When data is incompatible with formatpublic ErrorManager.ErrorEntry[] validateFormat()
null
if no error or error message if there is an
error.public abstract boolean isUnknown()
unknown value
. If any editing has occurred, then this
will return false
even if the editing is not complete.true
if this is unknown
.public abstract boolean input(char ch)
ch
- Input charactertrue
if input is accepted (nevertheless it
may be silently ignored in reality).public abstract boolean deleteBack()
true
if input is accepted (nevertheless it
may be silently ignored in reality).public abstract boolean deleteCurrent()
true
if input is accepted (nevertheless it
may be silently ignored in reality).public abstract boolean moveCursorLeft()
true
if input is accepted (nevertheless it
may be silently ignored in reality).public abstract boolean moveCursorRight()
true
if input is accepted (nevertheless it
may be silently ignored in reality).public abstract boolean moveCursorBegin()
true
if input is accepted (nevertheless it
may be silently ignored in reality).public abstract boolean moveCursorEnd()
true
if input is accepted (nevertheless it
may be silently ignored in reality).public abstract boolean finishEdit()
true
if rendering is necessary.public abstract java.lang.String toScreenValue()
public abstract void toVar(BaseDataType var)
var
- A variable which must be compatible with the format.public abstract boolean isFixedFont()