|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jmobilecore.ui.core.Component com.jmobilecore.ui.core.TextComponent com.jmobilecore.ui.core.TextField com.jmobilecore.ui.DateField
public class DateField
This class displays formatted textfield for entering date information Format of the date is specified by user. Blocks of digits are separated by divider.
Field Summary | |
---|---|
protected int |
day
|
protected static int[] |
days
|
static byte |
DD_MM_YYYY
Date format, example: 26/03/2004. |
char |
divider
The divider for date formatting |
static byte |
MM_DD_YYYY
Date format, example: 03/26/2004. |
protected int |
month
|
protected byte |
STYLE
The current DateField formatting style. |
protected int |
year
|
static byte |
YYYY_MM_DD
Date format, example: 2004:03:26. |
Fields inherited from class com.jmobilecore.ui.core.TextField |
---|
adjustment, calculatedCaretPosition, calculatedCursorOffset, composer, currentLength, DEFAULT_SIZE, echoChar, HOFFSET, SCROLLABLE, VOFFSET |
Fields inherited from class com.jmobilecore.ui.core.TextComponent |
---|
ALL_SPEC_CHARS, BORDER_GAP, BORDER_WIDTH, C_ALL_SPEC_CHARS, C_ALPHA, C_ALPHA_NUMERIC, C_ANY, C_EMAIL, C_EMAIL_SPEC_CHARS, C_LOWER_CASE, C_NO_CHARS, C_NUMERIC, C_SPACE, C_UPPER_CASE, cHandler, CHAR_OPTIONS, charOptionCounter, constraint, CURSOR_DELAY, CURSOR_TYPE_LINE, CURSOR_TYPE_SYMBOL, editable, EMAIL_SPEC_CHARS, insertMode, KEY_OPTIONS, lastKeyCode, LC_CHARS, NUMERIC_CHARS, SPACE_CHARS, UC_CHARS, validChars |
Fields inherited from class com.jmobilecore.ui.core.Component |
---|
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width |
Constructor Summary | |
---|---|
DateField()
Constructs a new DateField field. |
|
DateField(byte style)
Constructs a new DateField object of specified format. |
|
DateField(byte style,
char divider)
Constructs a new DateField object of specified format. |
|
DateField(byte style,
char divider,
java.util.Date date)
Constructs a new DateField object of specified format
with the specified value. |
Method Summary | |
---|---|
protected void |
getBlocks()
Sets day, month, year variables
If the field contains invalid value, the method sets
variable year to -1 |
java.util.Date |
getDate()
Returns the date value that is presented by this component. |
java.lang.String |
getFormattedText()
Get formatted representation of Ipv4Field value
or null if IPv4Field object value is set to null or incomplete |
protected char[] |
getFormattedText(boolean calcCursorOffset)
|
byte |
getStyle()
|
protected CustomFieldComposer |
initComposer()
Initialize date field composer |
boolean |
isValid()
Tests date field value for correctness |
void |
setDate(java.util.Date date)
Sets date that is presented by this date component to be the specified value. |
void |
setStyle(byte newStyle)
|
void |
setStyle(byte newStyle,
char divider)
|
void |
setStyle(byte newStyle,
char divider,
java.util.Date newDate)
|
Methods inherited from class com.jmobilecore.ui.core.TextField |
---|
adjust, destructor, getComposer, getCursorOffset, getText, init, keyPressed, paint, paintCursor, setHeight, setText |
Methods inherited from class com.jmobilecore.ui.core.TextComponent |
---|
addValidChars, getCaretPosition, getKeyOption, initCursor, isCharValid, preProcessKeyCode, processKeyCode, resetCursor, resetCursorHandler, setCaretPosition |
Methods inherited from class com.jmobilecore.ui.core.Component |
---|
getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyReleased, keyRepeated, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int day
protected static final int[] days
public static final byte DD_MM_YYYY
public char divider
public static final byte MM_DD_YYYY
protected int month
protected byte STYLE
protected int year
public static final byte YYYY_MM_DD
Constructor Detail |
---|
public DateField()
DateField
field.
public DateField(byte style)
DateField
object of specified format.
style
- the date formatpublic DateField(byte style, char divider)
DateField
object of specified format.
style
- the date formatdivider
- the divider for the date fieldpublic DateField(byte style, char divider, java.util.Date date)
DateField
object of specified format
with the specified value.
style
- the date formatdivider
- the divider for the date fielddate
- the date valuesetStyle(byte)
Method Detail |
---|
protected void getBlocks()
day, month, year
variables
If the field contains invalid value, the method sets
variable year
to -1
public java.util.Date getDate()
Date
value is set to 0 (hours,
minutes, seconds)
Date
representing the specified datepublic java.lang.String getFormattedText()
Ipv4Field
value
or null
if IPv4Field
object value is set to null or incomplete
String
representing bank card numberprotected char[] getFormattedText(boolean calcCursorOffset)
getFormattedText
in class TextField
public byte getStyle()
protected CustomFieldComposer initComposer()
CustomFieldComposer
for date fieldpublic boolean isValid()
true
if the date field is valid
false
otherwisepublic void setDate(java.util.Date date)
date
argument is ignored
date
- the date valuepublic void setStyle(byte newStyle)
public void setStyle(byte newStyle, char divider)
public void setStyle(byte newStyle, char divider, java.util.Date newDate)
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |