|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.Container com.sun.lwuit.Calendar
public class Calendar
Date widget for selecting a date/time value. To localize strings for month names use the values "Calendar.Month" using the 3 first characters of the month name in the resource localization e.g. "Calendar.Jan", "Calendar.Feb" etc... To localize strings for day names use the values "Calendar.Day" in the resource localization e.g. "Calendar.Sunday", "Calendar.Monday" etc...
Field Summary |
---|
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
Calendar()
Constructs a calendar with the current date and time |
|
Calendar(long time)
Creates a new instance of Calendar set to the given date based on time since epoch (the java.util.Date convention) |
|
Calendar(long time,
java.util.TimeZone tmz)
Creates a new instance of Calendar set to the given date based on time since epoch (the java.util.Date convention) |
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Fires when a change is made to the month view of this component |
void |
addDataChangeListener(DataChangedListener l)
Allows tracking selection changes in the calendar in real time |
protected Button |
createDay()
This method creates the Day Button Component for the Month View |
protected Label |
createDayTitle(int day)
This method creates the Day title Component for the Month View |
java.util.Date |
getDate()
Return the date object matching the current selection |
Style |
getMonthViewSelectedStyle()
Gets the selected style of the month view component within the calendar |
Style |
getMonthViewUnSelectedStyle()
Gets the un selected style of the month view component within the calendar |
long |
getSelectedDay()
Returns the time for the current calendar. |
java.util.TimeZone |
getTimeZone()
Gets the Calendar timezone |
boolean |
isChangesSelectedDateEnabled()
This flag determines if selected date can be changed by selecting an alternative date |
void |
removeActionListener(ActionListener l)
Fires when a change is made to the month view of this component |
void |
removeDataChangeListener(DataChangedListener l)
Allows tracking selection changes in the calendar in real time |
void |
setChangesSelectedDateEnabled(boolean changesSelectedDateEnabled)
This flag determines if selected date can be changed by selecting an alternative date |
void |
setCurrentDate(java.util.Date d)
Sets the Calendar view on the given date, only the the month and year are being considered. |
void |
setDate(java.util.Date d)
Sets the current date in the view and the selected date to be the same. |
void |
setMonthViewSelectedStyle(Style s)
Sets the selected style of the month view component within the calendar |
void |
setMonthViewUnSelectedStyle(Style s)
Sets the un selected style of the month view component within the calendar |
void |
setSelectedDate(java.util.Date d)
This method sets the Calendar selected day |
void |
setTimeZone(java.util.TimeZone tmz)
Sets the Calendar timezone, if not specified Calendar will use the default timezone |
protected void |
updateButtonDayDate(Button dayButton,
int currentMonth,
int day)
This method updates the Button day. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Calendar(long time)
time
- time since epochpublic Calendar()
public Calendar(long time, java.util.TimeZone tmz)
time
- time since epochtmz
- a reference timezoneMethod Detail |
---|
public long getSelectedDay()
public java.util.Date getDate()
public void setDate(java.util.Date d)
d
- new datepublic void setSelectedDate(java.util.Date d)
d
- the selected daypublic void setCurrentDate(java.util.Date d)
d
- the date to set the calendar view on.public void setTimeZone(java.util.TimeZone tmz)
tmz
- the timezonepublic java.util.TimeZone getTimeZone()
public void setMonthViewSelectedStyle(Style s)
s
- style for the month viewpublic void setMonthViewUnSelectedStyle(Style s)
s
- style for the month viewpublic Style getMonthViewSelectedStyle()
public Style getMonthViewUnSelectedStyle()
public void addActionListener(ActionListener l)
l
- listener to addpublic void removeActionListener(ActionListener l)
l
- listener to removepublic void addDataChangeListener(DataChangedListener l)
l
- listener to addpublic void removeDataChangeListener(DataChangedListener l)
l
- listener to removepublic void setChangesSelectedDateEnabled(boolean changesSelectedDateEnabled)
changesSelectedDateEnabled
- if true pressing on a date will cause
the selected date to be changed to the pressed onepublic boolean isChangesSelectedDateEnabled()
protected Button createDay()
protected Label createDayTitle(int day)
day
- the relevant day values are 0-6 where 0 is sunday.
protected void updateButtonDayDate(Button dayButton, int currentMonth, int day)
dayButton
- the button to be updatedday
- the new button day
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |