|
JDatePicker v4.3.25 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface WeekModel
A week model is a helper interface that lets you control various week
settings for a JMonth component.
The idea of this interface is to have a single point of control for various
week aspects. It can:
first day of weeknames of the week daysSelect a day of weekSelect a week of yearweek numbers of the year
MonthModel,
JMonth| Field Summary | |
|---|---|
static int |
NO_SELECTED_DOW
Indicates that no day of week is selected. |
static int |
NO_SELECTED_MONTH
Indicates that no month is selected. |
static int |
NO_SELECTED_WEEK
Indicates that no week is selected. |
static int |
NO_SELECTED_YEAR
Indicates that no year is selected. |
| Method Summary | |
|---|---|
void |
addWeekModelListener(WeekModelListener listener)
Adds an object that listens to changes in this model. |
int |
getDowFirst()
Returns the first day of week. |
java.lang.String[] |
getDowNames()
Determines the names of the week days ordered as specified by the first day of week. |
int[] |
getDows()
Returns the days of week starting with the first day of week. |
int |
getSelectedDow()
Returns the day of week selected by this model. |
int |
getSelectedMonth()
Returns the month to which the selected day of week belongs. |
int |
getSelectedWeek()
Returns the number of the selected week from current year. |
int |
getSelectedYear()
Returns the year to which the selected week belongs. |
int |
getWeekNumber(java.util.Date date,
java.util.TimeZone timezone)
Returns the week number for a specified date. |
boolean |
isDowSelectionAllowed()
Determines whether days of week may be selected. |
boolean |
isWeekSelectionAllowed()
Determines whether weeks of year may be selected. |
void |
removeWeekModelListener(WeekModelListener listener)
Removes a specified listener from the list of registered listeners. |
void |
setDowFirst(int day)
Specifies the first day of week. |
void |
setDowSelectionAllowed(boolean allowed)
Specifies whether days of week may be selected. |
void |
setSelectedDow(int month,
int dow)
Specifies the day of week that is selected by this model. |
void |
setSelectedWeek(int year,
int week)
Selects a week from a specified year. |
void |
setWeekSelectionAllowed(boolean allowed)
Specifies whether weeks of year may be selected. |
| Field Detail |
|---|
static final int NO_SELECTED_DOW
getSelectedDow(),
Constant Field Valuesstatic final int NO_SELECTED_MONTH
getSelectedMonth(),
Constant Field Valuesstatic final int NO_SELECTED_WEEK
getSelectedWeek(),
Constant Field Valuesstatic final int NO_SELECTED_YEAR
getSelectedYear(),
Constant Field Values| Method Detail |
|---|
void addWeekModelListener(WeekModelListener listener)
listener - the listener object that is informed about changes in this modelvoid removeWeekModelListener(WeekModelListener listener)
listener - the listener to be removedjava.lang.String[] getDowNames()
list with the days of week.
getDows(),
getDowFirst()int getSelectedDow()
Calendar.SUNDAY,
Calendar.MONDAY, etc. If no day of week is selected, then
the method will return NO_SELECTED_DOW.
setSelectedDow(int, int),
NO_SELECTED_DOWint getSelectedMonth()
NO_SELECTED_MONTH if no
dow is selected.NO_SELECTED_MONTH,
getSelectedDow(),
setSelectedDow(int, int)
void setSelectedDow(int month,
int dow)
dow - day of week that is selected (Calendar.SUNDAY,
Calendar.MONDAY, etc) or NO_SELECTED_DOW if
no date should be selectedmonth - month to which the dow belongsNO_SELECTED_DOW,
NO_SELECTED_MONTHboolean isDowSelectionAllowed()
true if days of week may be selected and
false otherwisesetDowSelectionAllowed(boolean)void setDowSelectionAllowed(boolean allowed)
JMonth component if the respective day is
clicked in the header.
allowed - if true, one may click on a day of week
to select it.int getDowFirst()
setDowFirst(int)int[] getDows()
Calendar.MONDAY.getDowFirst()void setDowFirst(int day)
day - day of week that is a java.util.Calendar
constant like Calendar.MONDAYint getSelectedWeek()
NO_SELECTED_WEEK if no
week is selected.NO_SELECTED_WEEK,
getSelectedYear(),
setSelectedWeek(int, int)int getSelectedYear()
NO_SELECTED_YEAR if no
year is selected.NO_SELECTED_YEAR,
getSelectedWeek(),
setSelectedWeek(int, int)
void setSelectedWeek(int year,
int week)
year - specified yearweek - specified weekNO_SELECTED_WEEK,
NO_SELECTED_YEARboolean isWeekSelectionAllowed()
true if weeks of week may be selected and
false otherwisesetWeekSelectionAllowed(boolean)void setWeekSelectionAllowed(boolean allowed)
JMonth component if the respective week number
is clicked.
allowed - if true, one may click on a week of year
to select it.
int getWeekNumber(java.util.Date date,
java.util.TimeZone timezone)
date - date for which the week number is computedtimezone - time zone used with the date to extract the week number
|
JDatePicker v4.3.25 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Visit www.jdatepicker.com for further information or send us your suggestions.
Copyright © 2003-2010 Elmro Ltd. All Rights Reserved.