|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Listener
danger.ui.View
danger.ui.Container
danger.ui.Control
danger.ui.DateTimeEditor
public class DateTimeEditor
A control to allow the user to edit a date or time.
| Field Summary | |
|---|---|
static int |
FORMAT_DATE_LONG
Specifies a long date format, such as December 25, 2005. |
static int |
FORMAT_DATE_MEDIUM
Specifies a medium date format, such as Dec 25, 2005. |
static int |
FORMAT_DATE_SHORT
Specifies a short date format, such as 12/25/2005. |
static int |
FORMAT_NONE
Deprecated. Not used. |
static int |
FORMAT_TIME_LONG
Specifies a long time format, such as 1:34 pm. |
protected Date |
mDate
Deprecated. Use setDate(java.util.Date, java.util.TimeZone) and getDate() instead. |
protected String |
mFormat
Deprecated. Use setFormat(int) instead. |
protected boolean |
mKeyEntry
Deprecated. For internal use only. |
protected Alarm |
mKeyInputAlarm
Deprecated. For internal use only. |
protected String |
mKeyString
Deprecated. For internal use only. |
protected int |
mLastKeyTime
Deprecated. For internal use only. |
protected Date |
mMaxDate
Deprecated. Use max(danger.internal.Date) instead. |
protected Date |
mMinDate
Deprecated. Use min(danger.internal.Date) instead. |
protected boolean |
mReflowAfterChange
Deprecated. For internal use only. |
protected int[] |
mViewCounts
Deprecated. For internal use only. |
protected StaticText[] |
mViews
Deprecated. For internal use only. |
protected int[] |
mViewTypes
Deprecated. For internal use only. |
protected static int |
STD_HEIGHT
Deprecated. For internal use only. |
protected static int |
STD_WIDTH
Deprecated. For internal use only. |
| Fields inherited from class danger.ui.Control |
|---|
mValue |
| Constructor Summary | |
|---|---|
DateTimeEditor()
Construct an instance of a DateTimeEditor, defaulting to the current date and time. |
|
DateTimeEditor(Date inDate)
Construct an instance of a DateTimeEditor with the specified date. |
|
DateTimeEditor(Date inDate,
int inFormat)
Construct an instance of a DateTimeEditor with the specified date and format. |
|
DateTimeEditor(Date inDate,
String inFormat)
Construct an instance of a DateTimeEditor with the specified date and format. |
|
DateTimeEditor(Date inDate,
TimeZone inTimeZone)
Construct an instance of a DateTimeEditor with the specified date and time zone. |
|
| Method Summary | |
|---|---|
protected void |
adjustPickerWindow(PickerWindow pw,
View inAlignView)
Deprecated. For internal use only. |
void |
disable()
Disables this container and all its children recursively. |
protected void |
drawBackground(Pen p,
Rect inRect)
Draw the background of the editor. |
void |
enable()
Enables this container and all its children recursively. |
void |
enforceLimitsAndUpdate()
Deprecated. For internal use only. |
protected void |
enforceMaxLimit()
Deprecated. For internal use only. |
protected void |
enforceMinLimit()
Deprecated. For internal use only. |
boolean |
eventKeyDown(char c,
Event event)
This method is called when the user presses a key. |
boolean |
eventKeyUp(char c,
Event event)
Processes key releases directed at this container. |
boolean |
eventWidgetDown(int widget,
Event event)
Handle the pressing of a device widget |
boolean |
eventWidgetUp(int widget,
Event event)
Handle the release of a device widget |
int |
getBaseline()
Get the baseline of this Control's text or label. |
Date |
getDate()
Get the current date value. |
Date |
getJavaDate()
Get the current date value as a java.util.Date object. |
protected void |
layout()
Deprecated. For internal use only. |
void |
limitToDangerEpoch()
Set the minimum and maximum allowable dates to fit in the Danger epoch, which has a range of 2000-2068. |
void |
limitToUnixEpoch()
Set the minimum and maximum allowable dates to fit in the Unix epoch, which has a range of 1970-2038. |
void |
max(Date inMaxDate)
Set the maximum allowable date. |
void |
max(Date inDate,
TimeZone inTimeZone)
Set the maximum allowable date. |
void |
min(Date inMinDate)
Set the minimum allowable date. |
void |
min(Date inDate,
TimeZone inTimeZone)
Set the minimum allowable date. |
void |
paint(Pen p)
Draw the contents of this View. |
boolean |
receiveEvent(Event e)
Entry point for event processing. |
protected void |
reflowDateLayout()
Deprecated. For internal use only. |
protected void |
reflowDateLayout(int inAmount)
Deprecated. For internal use only. |
void |
setDate(Date inDate)
Set the date. |
void |
setDate(Date inDate,
TimeZone inTimeZone)
Set the date and time zone. |
void |
setFocusedChild(View newFocus,
int direction)
Set the focus for the view container to a specific child object. |
void |
setFormat(int inFormat)
Set the format. |
void |
setFormat(String inFormat)
Set the format. |
void |
setSize(int inWidth,
int inHeight)
Simultaneously set the width and height of this View. |
protected void |
showAMPMPicker()
Deprecated. For internal use only. |
protected void |
showDayPicker()
Deprecated. For internal use only. |
protected void |
showHourPicker()
Deprecated. For internal use only. |
protected void |
showMinutePicker()
Deprecated. For internal use only. |
protected void |
showMonthPicker()
Deprecated. For internal use only. |
protected void |
showYearPicker()
Deprecated. For internal use only. |
protected void |
update()
Deprecated. For internal use only. |
| Methods inherited from class danger.ui.Control |
|---|
drawFocusBox, drawIdleBox, drawIdleBox, getEvent, getEventListener, getEventType, getHasBorder, getMaxToolTipLines, getTitle, getTitleSequence, getToolTip, getValue, hasToolTip, loseFocus, onSetHasBorder, onSetTitle, sendEvent, setEvent, setEvent, setEvent, setEvent, setEvent, setEventArg, setEventListener, setHasBorder, setMaxToolTipLines, setTitle, setTitle, setToolTip, setValue, showToolTip, takeFocus |
| Methods inherited from class danger.app.Listener |
|---|
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Date mDate
setDate(java.util.Date, java.util.TimeZone) and getDate() instead.protected Date mMaxDate
max(danger.internal.Date) instead.protected Date mMinDate
min(danger.internal.Date) instead.protected String mFormat
setFormat(int) instead.protected int mLastKeyTime
protected String mKeyString
protected boolean mKeyEntry
protected Alarm mKeyInputAlarm
protected StaticText[] mViews
protected int[] mViewTypes
protected int[] mViewCounts
protected boolean mReflowAfterChange
public static final int FORMAT_NONE
public static final int FORMAT_DATE_SHORT
DateTimeEditor(Date,int) and setFormat(int).
public static final int FORMAT_DATE_MEDIUM
DateTimeEditor(Date,int) and setFormat(int).
public static final int FORMAT_DATE_LONG
DateTimeEditor(Date,int) and setFormat(int).
public static final int FORMAT_TIME_LONG
DateTimeEditor(Date,int) and setFormat(int).
protected static final int STD_HEIGHT
protected static final int STD_WIDTH
| Constructor Detail |
|---|
public DateTimeEditor()
FORMAT_DATE_MEDIUM format
is used.
public DateTimeEditor(Date inDate)
FORMAT_DATE_MEDIUM format
is used.
public DateTimeEditor(Date inDate,
TimeZone inTimeZone)
FORMAT_DATE_MEDIUM format
is used.
public DateTimeEditor(Date inDate,
int inFormat)
inDate - the initial dateinFormat - the format to use. One of FORMAT_DATE_SHORT,
FORMAT_DATE_MEDIUM, FORMAT_DATE_LONG, and
FORMAT_TIME_LONG.
public DateTimeEditor(Date inDate,
String inFormat)
inDate - the initial dateinFormat - a string representation of the format to use.
See DateFormat for more details.| Method Detail |
|---|
public void setDate(Date inDate,
TimeZone inTimeZone)
inDate - the dateinTimeZone - the time zonepublic void setDate(Date inDate)
inDate - the datepublic void setFormat(int inFormat)
inFormat - the format to use. One of FORMAT_DATE_SHORT,
FORMAT_DATE_MEDIUM, FORMAT_DATE_LONG, and
FORMAT_TIME_LONG.public void setFormat(String inFormat)
inFormat - a string representation of the format to use.
See DateFormat for more details.public Date getDate()
Get the current date value.
public Date getJavaDate()
Get the current date value as a java.util.Date object.
public void enforceLimitsAndUpdate()
public void enable()
Container
enable in class Containerpublic void disable()
Container
disable in class Containerprotected void layout()
protected void reflowDateLayout(int inAmount)
protected void reflowDateLayout()
protected void update()
public void setSize(int inWidth,
int inHeight)
View
setSize in class Viewpublic boolean receiveEvent(Event e)
ListenerDispatcher when it reads an Event in its queue
that is targetted at this instance. The default behavior is to
do nothing and return false. Subclasses are expected
to override this method to do something more useful.
receiveEvent in class Containere - non-null; the event to process
true) or not (false) this
method actually handled the event to completion
protected void adjustPickerWindow(PickerWindow pw,
View inAlignView)
protected void showMonthPicker()
protected void showDayPicker()
protected void showYearPicker()
protected void showHourPicker()
protected void showMinutePicker()
protected void showAMPMPicker()
public void paint(Pen p)
ViewThe implementation of this method in this class will merely call
clear() pen, if this View is opaque (not transparent),
and will do nothing otherwise. If you don't need this behavior, then
there is no point in calling super.paint() in an
overriding method.
paint in class Containerp - non-null; the pen to use for drawing operationspublic int getBaseline()
ControlView.getHeight(), but subclasses that display text
should override it to return something more appropriate.
getBaseline in class Control
protected final void drawBackground(Pen p,
Rect inRect)
public boolean eventKeyUp(char c,
Event event)
Container
eventKeyUp in class Containerc - the character being released.
public void setFocusedChild(View newFocus,
int direction)
Containernull, then this
indicates that whatever child currently has focus should lose focus.
This throws an exception if you pass a non-null view
that is not a child of this instance.
setFocusedChild in class ContainernewFocus - null-ok; the child which should assume focus or
null if no child should have focusdirection - the direction the focus moved; one of
View.FOCUS_UPWARD, View.FOCUS_DOWNWARD, View.FOCUS_RIGHTWARD, or
View.FOCUS_LEFTWARD.Container.getFocusedChild()
public boolean eventKeyDown(char c,
Event event)
ViewView.setAtAndSpacePage(boolean).
eventKeyDown in class Container
public boolean eventWidgetUp(int widget,
Event event)
Container
eventWidgetUp in class Containerwidget - the widget that went down
public boolean eventWidgetDown(int widget,
Event event)
Container
eventWidgetDown in class Containerwidget - the widget that went up
public final void max(Date inMaxDate)
Set the maximum allowable date.
By default, the editor is unbounded.
public final void max(Date inDate,
TimeZone inTimeZone)
Set the maximum allowable date.
By default, the editor is unbounded.
public final void min(Date inMinDate)
Set the minimum allowable date.
By default, the editor is unbounded.
public final void min(Date inDate,
TimeZone inTimeZone)
Set the minimum allowable date.
By default, the editor is unbounded.
public final void limitToUnixEpoch()
Set the minimum and maximum allowable dates to fit in the Unix epoch, which has a range of 1970-2038.
By default, the editor is unbounded.
public final void limitToDangerEpoch()
Set the minimum and maximum allowable dates to fit in the Danger epoch, which has a range of 2000-2068.
By default, the editor is unbounded.
protected final void enforceMinLimit()
protected final void enforceMaxLimit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||