|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.combobox.PopupPanel com.jidesoft.combobox.DateChooserPanel
public class DateChooserPanel
DateChooserPanel is a popup panel that can choose Date. User can click and select a Date. It also support various operations such as typing year directly, choose a month from a popup menu, go to next or previous month. It also supports ItemListener. Whenever a Date is selected, itemStateChanged will be fired.
By default, DateChooserPanel only supports single selection, meaning only one date can be selected at a time. It also supports multiple selections such as a range of dates or several ranges of dates. You can choose which selection mode by callinggetSelectionModel()
, then call DateSelectionModel.setSelectionMode(int)
. You can always
use methods on DateSelectionModel to find out current selection or get notification if selection changes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected ButtonPanel |
_buttonPanel
|
ItemListener |
_itemListener
|
static int |
NAVIGATION_BUTTON_HEIGHT
|
static int |
NAVIGATION_BUTTON_WIDTH
|
static String |
PROPERTY_DISPLAY_MONTH
|
static String |
PROPERTY_SHOW_NEXT_BUTTON
|
static String |
PROPERTY_SHOW_NEXT_MONTH_DAYS
|
static String |
PROPERTY_SHOW_NEXT_YEAR_BUTTON
|
static String |
PROPERTY_SHOW_NONE_BUTTON
|
static String |
PROPERTY_SHOW_OK_BUTTON
|
static String |
PROPERTY_SHOW_PREVIOUS_BUTTON
|
static String |
PROPERTY_SHOW_PREVIOUS_MONTH_DAYS
|
static String |
PROPERTY_SHOW_PREVIOUS_YEAR_BUTTON
|
static String |
PROPERTY_SHOW_TODAY_BUTTON
|
static String |
PROPERTY_SHOW_WEEK_NUMBERS
|
static String |
PROPERTY_SHOW_YEAR_BUTTONS
|
static String |
PROPERTY_TODAY_HIGHLIGHTED
|
static String |
PROPERTY_VIEWONLY
|
static String |
VIEWONLY_PROPERTY
Property of view only. |
Fields inherited from class com.jidesoft.combobox.PopupPanel |
---|
_previousSelectedObject, SELECTED_BY_MOUSE_ROLLOVER |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DateChooserPanel()
Creates a new DateChooserPanel with DefaultDateModel. |
|
DateChooserPanel(boolean useToday)
Choose to use today button. |
|
DateChooserPanel(boolean useToday,
boolean useNone)
Choose to use today or none button. |
|
DateChooserPanel(boolean useToday,
boolean useNone,
boolean showWeeks)
Choose to use the |
|
DateChooserPanel(DateModel model)
Set a model and show today, none buttons and week of year labels |
|
DateChooserPanel(DateModel model,
boolean useToday)
Set a model and choose to show today. |
|
DateChooserPanel(DateModel model,
boolean useToday,
boolean useNone)
Set a DateModel and choose to see today or none. |
|
DateChooserPanel(DateModel model,
boolean useToday,
boolean useNone,
boolean showWeeks)
Creates a new DateChooserPanel with a specified DateModel. |
|
DateChooserPanel(DateModel model,
boolean useToday,
boolean useNone,
boolean showWeeks,
Locale locale)
Creates a new DateChooserPanel with a specified DateModel. |
|
DateChooserPanel(DateModel model,
boolean useToday,
boolean useNone,
boolean showWeeks,
String timeFormat,
Locale locale)
Creates a new DateChooserPanel with a specified DateModel. |
|
DateChooserPanel(DateModel model,
Locale locale)
Set a model and show today, none buttons and week of year labels |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
protected void |
addModelListener()
Adds DateModelListener to DateModel. |
protected void |
changeSelectedCalendar()
|
Calendar |
changeSelection(Date date,
boolean toggle,
boolean extend)
Changes the selected date. |
protected void |
checkShortenLabels()
Check if the labels with the weekday names (Sun, Mon, Tue, Wed, Thu, Fri, Sat, Sun) will fill on all the labels, if any one will not fit the 3 letters, then shorten the labels to (S,M,T,W,T,F,S) |
void |
componentHidden(ComponentEvent ce)
|
void |
componentMoved(ComponentEvent ce)
|
void |
componentResized(ComponentEvent ce)
|
void |
componentShown(ComponentEvent ce)
|
static Calendar |
convertToMidnight(Calendar instance)
|
protected AbstractButton |
createButton(String text,
String mnemonic)
|
protected Component |
createButtonPanel()
Creates the the bottom button panel. |
protected Calendar |
createCalendarInstance()
Creates a new Calendar instance that will be used internally. |
protected JComponent |
createDateLabel(int i)
Creates the component that will display the date in DateChooserPanel . |
protected Component |
createDatePanel()
|
protected Component |
createDayHeaderPanel()
|
protected JComponent |
createDayOfWeekLabel(int i)
|
protected Component |
createDayPanel()
|
protected JComponent |
createMonthLabel()
|
protected Component |
createMonthPanel()
|
protected Component |
createMonthYearPanel()
Create the panel contains the month and year information. |
protected JPanel |
createPanel(LayoutManager layoutManager)
|
protected DateSpinner |
createTimeSpinner()
Creates time spinner. |
protected JComponent |
createWeekOfYearLabel(int i)
|
protected JComponent |
createWeekOfYearPanel()
|
protected JComponent |
createYearLabel()
|
protected MouseListener |
createYearLabelListener()
Create the mouse listener for the year label. |
void |
dateModelChanged(DateModelEvent e)
This notification tells listeners the something changed in date model. |
void |
disableMouseWheel()
|
void |
doLayout()
|
void |
enableMouseWheel()
|
protected ButtonPanel |
getButtonPanel()
Gets the ButtonPanel that contains the "Today", "None" buttons. |
protected Border |
getButtonsBorder()
|
CalendarViewer |
getCalendarViewer()
|
DateModel |
getDateModel()
Gets the DateModel. |
protected Map<Component,Date> |
getDayMap()
|
Component |
getDefaultFocusComponent()
Gets the default focus component. |
Calendar |
getDisplayedCalendar()
Get the displayed calendar for this date chooser. |
int |
getDisplayIndex()
|
protected Border |
getEmptyBorder()
|
int |
getFirstDayOfWeek()
Gets the first day of the week is; e.g., Sunday in US, Monday in France. |
SimpleDateFormat |
getMonthFormatter()
|
protected JComponent |
getMonthLabel()
|
protected Color |
getMonthYearBackground()
|
protected Border |
getMonthYearBorder()
|
protected Color |
getMonthYearForeground()
|
protected JPanel |
getMonthYearPanel()
Gets the panel that includes the month label and year label. |
protected AbstractButton |
getNextButton()
|
protected AbstractButton |
getNextYearButton()
|
protected AbstractButton |
getNoneButton()
|
protected AbstractButton |
getPrevButton()
|
protected AbstractButton |
getPrevYearButton()
|
protected String |
getResourceString(String key,
Locale locale)
Gets the localized string from resource bundle of specified locale. |
Calendar |
getSelectedCalendar()
Gets the selected calendar. |
Date |
getSelectedDate()
Gets the selected date. |
protected int |
getSelectedDay()
|
int |
getSelectedHour()
|
int |
getSelectedMillisecond()
|
int |
getSelectedMinute()
|
protected int |
getSelectedMonth()
|
int |
getSelectedSecond()
|
protected int |
getSelectedYear()
|
DateSelectionModel |
getSelectionModel()
Gets selection model. |
protected JTextField |
getTextField(JSpinner spinner)
Return the formatted text field used by the editor, or null if the editor doesn't descend from JSpinner.DefaultEditor. |
String |
getTimeFormat()
|
TimeZone |
getTimeZone()
|
JPanel |
getTitlePanel()
Gets the panel that includes the month year panel and the next/previous month buttons. |
protected AbstractButton |
getTodayButton()
|
protected Calendar |
getTodayCalendar()
|
protected int |
getTodayDay()
|
protected int |
getTodayMonth()
|
protected int |
getTodayYear()
|
SimpleDateFormat |
getWeekFormatter()
|
SimpleDateFormat |
getWeekOfYearFormatter()
|
SimpleDateFormat |
getYearFormatter()
|
protected JComponent |
getYearLabel()
|
protected SpinnerModel |
getYearModel()
|
protected JComponent |
getYearSpinner()
|
protected int |
hideYearSpinner()
|
protected void |
initCalendar()
|
protected void |
initComponents()
|
protected void |
initDateFormat(Locale locale)
|
boolean |
isAlwaysShowShortWeekLabels()
|
protected boolean |
isDateSelected(Calendar calendar)
|
protected boolean |
isDayOutOfRange(Calendar calendar)
Checks if the day is out of the range of the DateModel. |
protected boolean |
isMonthOutOfRange(Calendar calendar)
Checks if the month is out of the range of the DateModel. |
boolean |
isSelectAllDatesOnToggleMode()
Get the flag indicating if it should select all dates first instead of toggling all dates selection while clicking on the DayOfWeek label or WeekOfYear label. |
boolean |
isSelectDateOnSameMonth()
Get the flag indicating if only the dates on the same month would be selected while clicking on the DayOfWeek label or WeekOfYear label. |
boolean |
isShowMonthMenu()
Gets the flag indicating if the month popup menu will show up when the customer click on the month label. |
boolean |
isShowNextButton()
Checks if next button is visible. |
boolean |
isShowNextMonthDays()
|
boolean |
isShowNextYearButton()
Checks if next year button is visible. |
boolean |
isShowNoneButton()
Checks if none button is visible. |
boolean |
isShowOKButton()
Checks if OK button is visible. |
boolean |
isShowPreviousButton()
Checks if previous button is visible. |
boolean |
isShowPreviousMonthDays()
|
boolean |
isShowPreviousYearButton()
Checks if previous year button is visible. |
protected boolean |
isShowShortWeekLabels()
|
boolean |
isShowTodayButton()
Checks if today button is visible. |
boolean |
isShowWeekNumbers()
Checks if the week of year panel is visible. |
boolean |
isShowYearButtons()
Get the flag indicating if DateChooserPanel will buttons for next/previous year selection. |
boolean |
isShowYearSpinner()
Get the flag indicating if the year spinner will show up when the customer click on the year label. |
protected boolean |
isSingleSelectionMode()
|
boolean |
isTimeDisplayed()
|
protected boolean |
isToday(Calendar calendar)
|
boolean |
isTodayHighlighted()
|
boolean |
isToggleMode()
Get the flag indicating that if the selection is in toggle mode without pressing the CTRL key while selecting the date labels. |
boolean |
isViewOnly()
If the DateChooserPanel is view-only. |
void |
mouseClicked(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
mouseWheelMoved(MouseWheelEvent e)
|
protected void |
nextDay()
|
protected void |
nextDisplayMonth()
|
protected void |
nextDisplayYear()
|
protected void |
nextMonth()
|
protected void |
nextWeek()
|
protected void |
nextYear()
|
void |
paint(Graphics g)
|
protected void |
prevDay()
|
protected void |
prevDisplayMonth()
|
protected void |
prevDisplayYear()
|
protected void |
prevMonth()
|
protected void |
prevWeek()
|
protected void |
prevYear()
|
protected void |
registerKeyStrokes()
|
protected void |
removeModeListener()
|
void |
setAlwaysShowShortWeekLabels(boolean alwaysShowShortWeekLabels)
|
protected void |
setButtonPanel(ButtonPanel panel)
|
protected void |
setButtonsBorder(Border border)
|
void |
setCalendarViewer(CalendarViewer calendarViewer)
|
void |
setDateModel(DateModel dateModel)
Sets the DateModel. |
boolean |
setDisplayedMonth(int year,
int month)
This method will set the year and month this panel will display. |
boolean |
setDisplayedMonth(int year,
int month,
boolean force)
|
protected void |
setDisplayedTime(Calendar calendar)
Sets the displayed time to time spinner. |
void |
setDisplayIndex(int displayIndex)
|
void |
setEnabled(boolean enabled)
|
void |
setFirstDayOfWeek(int firstDayOfWeek)
Sets the first day of the week is; e.g., Sunday in US, Monday in France. |
void |
setLocale(Locale locale)
|
protected void |
setMonthLabel(JComponent component)
|
protected void |
setMonthYearBackground(Color background)
|
protected void |
setMonthYearBorder(Border border)
|
protected void |
setMonthYearForeground(Color foreground)
|
protected void |
setMonthYearPanel(JPanel panel)
|
protected void |
setNextButton(AbstractButton button)
|
protected void |
setNextYearButton(AbstractButton button)
|
protected void |
setNoneButton(AbstractButton button)
|
protected void |
setPrevButton(AbstractButton button)
|
protected void |
setPrevYearButton(AbstractButton button)
|
void |
setSelectAllDatesOnToggleMode(boolean selectAllDatesOnToggleMode)
Set the flag indicating if it should select all dates first instead of toggling all dates selection while clicking on the DayOfWeek label or WeekOfYear label. |
void |
setSelectDateOnSameMonth(boolean selectDateOnSameMonth)
Set the flag indicating if only the dates on the same month would be selected while clicking on the DayOfWeek label or WeekOfYear label. |
void |
setSelectedCalendar(Calendar selectedCalendar)
Sets the selected calendar. |
void |
setSelectedDate(Date selectedDate)
Sets the selected date. |
protected void |
setSelectedDay(int day)
|
void |
setSelectedHour(int hour)
|
void |
setSelectedMillisecond(int millisecond)
|
void |
setSelectedMinute(int minute)
|
protected void |
setSelectedMonth(int month)
|
void |
setSelectedObject(Object selectedObject,
boolean fireEvent)
Sets the selected object and fire ItemEvent . |
void |
setSelectedSecond(int second)
|
protected void |
setSelectedYear(int year)
|
void |
setSelectionModel(DateSelectionModel selectionModel)
Sets selection model. |
void |
setShowMonthMenu(boolean showMonthMenu)
Sets the flag indicating if the month popup menu will show up when the customer click on the month label. |
void |
setShowNextButton(boolean showNextButton)
Sets the next button visible. |
void |
setShowNextMonthDays(boolean showNextMonthDays)
By default a DateChooserPanel will show next month dates in current monthly view but in gray color. |
void |
setShowNextYearButton(boolean showNextYearButton)
Sets the next year button visible. |
void |
setShowNoneButton(boolean showNoneButton)
Sets the none button visible. |
void |
setShowOKButton(boolean showOKButton)
Sets the OK button visible. |
void |
setShowPreviousButton(boolean showPreviousButton)
Sets the previous button visible. |
void |
setShowPreviousMonthDays(boolean showPreviousMonthDays)
By default a DateChooserPanel will show previous month dates in current monthly view but in gray color. |
void |
setShowPreviousYearButton(boolean showPreviousYearButton)
Sets the previous year button visible. |
protected void |
setShowShortWeekLabels(boolean sWeekLabels)
|
void |
setShowTodayButton(boolean showTodayButton)
Sets the today button visible. |
void |
setShowWeekNumbers(boolean showWeekNumbers)
Sets the week of year panel visible. |
void |
setShowYearButtons(boolean showYearButtons)
Set the flag indicating if DateChooserPanel will buttons for next/previous year selection. |
void |
setShowYearSpinner(boolean showYearSpinner)
Set the flag indicating if the year spinner will show up when the customer click on the year label. |
void |
setTimeDisplayed(boolean timeDisplayed)
|
void |
setTimeZone(TimeZone timeZone)
|
protected void |
setTodayButton(AbstractButton button)
|
protected void |
setTodayCalendar(Calendar cal)
|
protected void |
setTodayDay(int tday)
|
void |
setTodayHighlighted(boolean todayHighlighted)
|
protected void |
setTodayMonth(int tmonth)
|
protected void |
setTodayYear(int year)
|
void |
setToggleMode(boolean toggleMode)
Set the flag indicating that if the selection is in toggle mode without pressing the CTRL key while selecting the date labels. |
void |
setViewOnly(boolean viewOnly)
Sets the view only attribute. |
protected void |
setYearLabel(JComponent component)
|
protected void |
setYearModel(SpinnerModel model)
|
protected void |
setYearSpinner(JComponent spinner)
|
protected boolean |
shouldKeepCurrentSelection(MouseEvent e)
Check if the current selection should be kept. |
protected void |
showPopup(MouseEvent e)
|
protected void |
showYearSpinner()
|
protected void |
updateButtons(ButtonPanel buttonPanel)
|
void |
updateCalendar()
Update calendar to update all UI components inside DateChooserPanel. |
protected void |
updateDateLabel(JComponent dateLabel,
Calendar date,
boolean isSelected,
boolean isToday,
boolean withinCurrentMonth)
Updates the date label with the correct data value. |
protected void |
updateDayOfWeekLabel(JComponent dayOfWeekLabel,
Calendar calendar)
|
protected Calendar |
updateDisplayedTime(Date date)
Updates the time value from the time spinner. |
protected void |
updateMonthLabel(JComponent monthLabel,
Calendar calendar)
|
protected void |
updateMonthNavigationButtons(Calendar cal)
Enables or disables the month navigation buttons depending on the current displayed calendar. |
protected void |
updateTextAndMnemonic(AbstractButton button,
String prefix,
Locale locale)
Updates the mnemonic for the OK or today or none button. |
void |
updateUI()
|
protected void |
updateWeekOfYearLabel(JComponent weekOfYearLabel,
Calendar calendar)
|
protected void |
updateYearLabel(JComponent yearLabel,
Calendar calendar)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String VIEWONLY_PROPERTY
public static final String PROPERTY_VIEWONLY
protected ButtonPanel _buttonPanel
public static int NAVIGATION_BUTTON_HEIGHT
public static int NAVIGATION_BUTTON_WIDTH
public ItemListener _itemListener
public static final String PROPERTY_DISPLAY_MONTH
public static final String PROPERTY_SHOW_NONE_BUTTON
public static final String PROPERTY_SHOW_OK_BUTTON
public static final String PROPERTY_SHOW_TODAY_BUTTON
public static final String PROPERTY_SHOW_WEEK_NUMBERS
public static final String PROPERTY_SHOW_PREVIOUS_BUTTON
public static final String PROPERTY_SHOW_NEXT_BUTTON
public static final String PROPERTY_SHOW_PREVIOUS_YEAR_BUTTON
public static final String PROPERTY_SHOW_NEXT_YEAR_BUTTON
public static final String PROPERTY_SHOW_YEAR_BUTTONS
public static final String PROPERTY_SHOW_PREVIOUS_MONTH_DAYS
public static final String PROPERTY_SHOW_NEXT_MONTH_DAYS
public static final String PROPERTY_TODAY_HIGHLIGHTED
Constructor Detail |
---|
public DateChooserPanel()
DateChooserPanel
with DefaultDateModel.
public DateChooserPanel(boolean useToday)
useToday
- booleanpublic DateChooserPanel(boolean useToday, boolean useNone)
useToday
- booleanuseNone
- booleanpublic DateChooserPanel(boolean useToday, boolean useNone, boolean showWeeks)
useToday
- booleanuseNone
- booleanshowWeeks
- booleanpublic DateChooserPanel(DateModel model)
model
- DateModelpublic DateChooserPanel(DateModel model, Locale locale)
model
- DateModel the DateModellocale
- the Localepublic DateChooserPanel(DateModel model, boolean useToday)
model
- DateModeluseToday
- booleanpublic DateChooserPanel(DateModel model, boolean useToday, boolean useNone)
model
- DateModeluseToday
- booleanuseNone
- booleanpublic DateChooserPanel(DateModel model, boolean useToday, boolean useNone, boolean showWeeks)
DateChooserPanel
with a specified DateModel. Set a model and choose to see today,
none, and weeks of the year.
model
- DateModeluseToday
- booleanuseNone
- booleanshowWeeks
- booleanpublic DateChooserPanel(DateModel model, boolean useToday, boolean useNone, boolean showWeeks, Locale locale)
DateChooserPanel
with a specified DateModel. Set a model and choose to see today,
none, and weeks of the year.
model
- DateModeluseToday
- booleanuseNone
- booleanshowWeeks
- booleanlocale
- the Localepublic DateChooserPanel(DateModel model, boolean useToday, boolean useNone, boolean showWeeks, String timeFormat, Locale locale)
DateChooserPanel
with a specified DateModel. Set a model and choose to see today,
none, and weeks of the year.
model
- DateModeluseToday
- booleanuseNone
- booleanshowWeeks
- booleantimeFormat
- the format for time spinnerlocale
- the LocaleMethod Detail |
---|
protected boolean shouldKeepCurrentSelection(MouseEvent e)
e
- the mouse event
public DateModel getDateModel()
public void setDateModel(DateModel dateModel)
dateModel
- the new DateModelprotected void addModelListener()
protected void removeModeListener()
public void dateModelChanged(DateModelEvent e)
DateModelListener
dateModelChanged
in interface DateModelListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
protected void showYearSpinner()
protected int hideYearSpinner()
protected void showPopup(MouseEvent e)
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
protected void setDisplayedTime(Calendar calendar)
calendar
- the displayed time.protected Calendar updateDisplayedTime(Date date)
date
- the Date
protected void changeSelectedCalendar()
protected void nextMonth()
protected void nextDisplayMonth()
protected boolean isMonthOutOfRange(Calendar calendar)
calendar
- the calendar.
protected boolean isDayOutOfRange(Calendar calendar)
calendar
- the calendar.
protected boolean isSingleSelectionMode()
protected void prevDisplayMonth()
protected void prevMonth()
protected void nextDisplayYear()
protected void nextYear()
protected void prevDisplayYear()
protected void prevYear()
protected void nextDay()
protected void prevDay()
protected void nextWeek()
protected void prevWeek()
public Date getSelectedDate()
public Calendar getSelectedCalendar()
public void setSelectedDate(Date selectedDate)
selectedDate
- the new selected Datepublic void setSelectedCalendar(Calendar selectedCalendar)
selectedCalendar
- the new selected Calendarpublic boolean setDisplayedMonth(int year, int month)
year
- Year to be viewedmonth
- Month to be viewed. It's 0 based to be compatible with Calendar. So 0 means Jan, 1 means Feb. etc.
Pass in -1 if you want to keep the current month and just change the year
public boolean setDisplayedMonth(int year, int month, boolean force)
public Calendar getDisplayedCalendar()
protected Component createDayPanel()
protected Component createDayHeaderPanel()
protected JComponent createWeekOfYearPanel()
protected JComponent createDayOfWeekLabel(int i)
protected JComponent createWeekOfYearLabel(int i)
protected Component createDatePanel()
protected JComponent createDateLabel(int i)
DateChooserPanel
.
i
- the index of the date component. For example, the first one at the top left corner index is 0, the
horizontally next one has index 1, and so on.
updateDateLabel(javax.swing.JComponent,java.util.Calendar,boolean,boolean,boolean)
protected JTextField getTextField(JSpinner spinner)
spinner
- the spinner
protected MouseListener createYearLabelListener()
protected Component createMonthYearPanel()
protected Component createButtonPanel()
protected AbstractButton createButton(String text, String mnemonic)
protected DateSpinner createTimeSpinner()
protected void updateButtons(ButtonPanel buttonPanel)
public void doLayout()
doLayout
in class Container
protected void initCalendar()
public void updateUI()
updateUI
in class JPanel
protected void initComponents()
protected Component createMonthPanel()
public void setSelectedObject(Object selectedObject, boolean fireEvent)
PopupPanel
ItemEvent
. It will still fire event even the new selected object
is the same as old selected object.
setSelectedObject
in class PopupPanel
selectedObject
- new selected objectfireEvent
- if fire the ItemEventpublic void updateCalendar()
protected void updateMonthNavigationButtons(Calendar cal)
cal
- the currently displayed calendar.public static Calendar convertToMidnight(Calendar instance)
protected JPanel createPanel(LayoutManager layoutManager)
public boolean isViewOnly()
public void setViewOnly(boolean viewOnly)
viewOnly
- true or false.public void setEnabled(boolean enabled)
setEnabled
in class JComponent
protected void checkShortenLabels()
protected void updateDayOfWeekLabel(JComponent dayOfWeekLabel, Calendar calendar)
protected void updateWeekOfYearLabel(JComponent weekOfYearLabel, Calendar calendar)
protected void updateDateLabel(JComponent dateLabel, Calendar date, boolean isSelected, boolean isToday, boolean withinCurrentMonth)
dateLabel
- the component that is used to display the date. By default, we use a JideButton. You
can override createDateLabel(int)
method to create your own component for the
date. If so, this parameter will be the component you created.date
- the date to be displayed on this date label.isSelected
- if the date is the selected dateisToday
- if the date is the today date.withinCurrentMonth
- if the date is within the current displayed month.protected void updateMonthLabel(JComponent monthLabel, Calendar calendar)
protected void updateYearLabel(JComponent yearLabel, Calendar calendar)
protected JComponent createMonthLabel()
protected JComponent createYearLabel()
public int getFirstDayOfWeek()
public void setFirstDayOfWeek(int firstDayOfWeek)
Calendar.SUNDAY
, Calendar.MONDAY
etc.
firstDayOfWeek
- the first day of the weekpublic boolean isShowWeekNumbers()
public void setShowWeekNumbers(boolean showWeekNumbers)
showWeekNumbers
- true or false.public boolean isShowTodayButton()
public void setShowTodayButton(boolean showTodayButton)
showTodayButton
- true or false.public boolean isShowNoneButton()
public void setShowNoneButton(boolean showNoneButton)
showNoneButton
- true or false.public boolean isShowOKButton()
public void setShowOKButton(boolean showOKButton)
showOKButton
- true or false.public boolean isShowPreviousButton()
public void setShowPreviousButton(boolean showPreviousButton)
showPreviousButton
- true or false.public boolean isShowNextButton()
public void setShowNextButton(boolean showNextButton)
showNextButton
- true or false.public boolean isShowPreviousYearButton()
public void setShowPreviousYearButton(boolean showPreviousYearButton)
showPreviousYearButton
- true or false.public boolean isShowNextYearButton()
public void setShowNextYearButton(boolean showNextYearButton)
showNextYearButton
- true or false.public boolean isShowPreviousMonthDays()
public void setShowPreviousMonthDays(boolean showPreviousMonthDays)
showPreviousMonthDays
- true or false.public boolean isShowNextMonthDays()
public void setShowNextMonthDays(boolean showNextMonthDays)
showNextMonthDays
- true or false.protected void registerKeyStrokes()
protected void initDateFormat(Locale locale)
public void setLocale(Locale locale)
setLocale
in class Component
protected void updateTextAndMnemonic(AbstractButton button, String prefix, Locale locale)
button
- the okButton or the todayButton or the noneButton.prefix
- the prefix. It could be "now" or "today" for the todayButton or "none" for the noneButton or "ok"
for OK button.locale
- the localepublic void componentHidden(ComponentEvent ce)
componentHidden
in interface ComponentListener
public void componentShown(ComponentEvent ce)
componentShown
in interface ComponentListener
public void componentMoved(ComponentEvent ce)
componentMoved
in interface ComponentListener
public void componentResized(ComponentEvent ce)
componentResized
in interface ComponentListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
public void enableMouseWheel()
public void disableMouseWheel()
protected JComponent getYearLabel()
protected void setYearLabel(JComponent component)
protected JComponent getMonthLabel()
protected void setMonthLabel(JComponent component)
protected JComponent getYearSpinner()
protected void setYearSpinner(JComponent spinner)
protected void setYearModel(SpinnerModel model)
protected SpinnerModel getYearModel()
protected void setMonthYearBackground(Color background)
protected Color getMonthYearBackground()
protected void setMonthYearForeground(Color foreground)
protected Color getMonthYearForeground()
protected void setMonthYearPanel(JPanel panel)
protected JPanel getMonthYearPanel()
public JPanel getTitlePanel()
protected void setNextYearButton(AbstractButton button)
protected AbstractButton getNextYearButton()
protected void setPrevYearButton(AbstractButton button)
protected AbstractButton getPrevYearButton()
protected void setNextButton(AbstractButton button)
protected AbstractButton getNextButton()
protected void setPrevButton(AbstractButton button)
protected AbstractButton getPrevButton()
protected Map<Component,Date> getDayMap()
protected void setMonthYearBorder(Border border)
protected Border getMonthYearBorder()
protected void setButtonPanel(ButtonPanel panel)
protected ButtonPanel getButtonPanel()
protected void setTodayButton(AbstractButton button)
protected AbstractButton getTodayButton()
protected void setNoneButton(AbstractButton button)
protected AbstractButton getNoneButton()
protected void setButtonsBorder(Border border)
protected Border getButtonsBorder()
protected Border getEmptyBorder()
protected void setTodayCalendar(Calendar cal)
protected Calendar getTodayCalendar()
protected void setTodayYear(int year)
protected int getTodayYear()
protected void setTodayMonth(int tmonth)
protected int getTodayMonth()
protected void setTodayDay(int tday)
protected int getTodayDay()
protected void setSelectedYear(int year)
protected int getSelectedYear()
protected void setSelectedMonth(int month)
protected int getSelectedMonth()
protected void setSelectedDay(int day)
protected int getSelectedDay()
public int getSelectedHour()
public void setSelectedHour(int hour)
public int getSelectedMinute()
public void setSelectedMinute(int minute)
public int getSelectedSecond()
public void setSelectedSecond(int second)
public int getSelectedMillisecond()
public void setSelectedMillisecond(int millisecond)
protected void setShowShortWeekLabels(boolean sWeekLabels)
protected boolean isShowShortWeekLabels()
public void setTodayHighlighted(boolean todayHighlighted)
public boolean isTodayHighlighted()
protected boolean isDateSelected(Calendar calendar)
public boolean isAlwaysShowShortWeekLabels()
public void setAlwaysShowShortWeekLabels(boolean alwaysShowShortWeekLabels)
protected boolean isToday(Calendar calendar)
protected String getResourceString(String key, Locale locale)
key
- the key of the stringlocale
- the locale the key of the string
public SimpleDateFormat getMonthFormatter()
public SimpleDateFormat getYearFormatter()
public SimpleDateFormat getWeekFormatter()
public SimpleDateFormat getWeekOfYearFormatter()
public boolean isShowYearButtons()
public void setShowYearButtons(boolean showYearButtons)
showYearButtons
- the flagisShowYearButtons()
public boolean isShowMonthMenu()
public void setShowMonthMenu(boolean showMonthMenu)
showMonthMenu
- the flagpublic boolean isShowYearSpinner()
public void setShowYearSpinner(boolean showYearSpinner)
showYearSpinner
- the flagpublic boolean isToggleMode()
public void setToggleMode(boolean toggleMode)
toggleMode
- the flagisToggleMode()
public boolean isSelectDateOnSameMonth()
public void setSelectDateOnSameMonth(boolean selectDateOnSameMonth)
selectDateOnSameMonth
- the flagisSelectDateOnSameMonth()
public boolean isSelectAllDatesOnToggleMode()
isToggleMode()
returns true.
isToggleMode()
public void setSelectAllDatesOnToggleMode(boolean selectAllDatesOnToggleMode)
isToggleMode()
returns true.
selectAllDatesOnToggleMode
- the flagisToggleMode()
,
isSelectAllDatesOnToggleMode()
public boolean isTimeDisplayed()
public void setTimeDisplayed(boolean timeDisplayed)
public Component getDefaultFocusComponent()
PopupPanel
getDefaultFocusComponent
in class PopupPanel
public String getTimeFormat()
public DateSelectionModel getSelectionModel()
public void setSelectionModel(DateSelectionModel selectionModel)
selectionModel
- new DateSelectionModelpublic Calendar changeSelection(Date date, boolean toggle, boolean extend)
date
- date to be selected. See description below.toggle
- true or false. See description below.extend
- true or false. See description below.
public int getDisplayIndex()
public void setDisplayIndex(int displayIndex)
public CalendarViewer getCalendarViewer()
public void setCalendarViewer(CalendarViewer calendarViewer)
public TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
protected Calendar createCalendarInstance()
public void paint(Graphics g)
paint
in class JComponent
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |