|
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 com.jidesoft.combobox.AbstractComboBox com.jidesoft.combobox.DateComboBox
public class DateComboBox
DateComboBox
is a combobox which can be used to choose a Date
.
Nested Class Summary | |
---|---|
class |
DateComboBox.DateEditorComponent
EditorComponent for DateComboBox when it is not readonly. |
class |
DateComboBox.DateRendererComponent
EditorComponent for DateComboBox when it is readonly. |
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 | |
---|---|
static String |
PROPERTY_SHOW_NONE_BUTTON
|
static String |
PROPERTY_SHOW_OK_BUTTON
|
static String |
PROPERTY_SHOW_TODAY_BUTTON
|
static String |
PROPERTY_SHOW_WEEK_NUMBERS
|
Fields inherited from class com.jidesoft.combobox.AbstractComboBox |
---|
_dialog, _editable, _editor, _listDataListener, _oldSelectedItemReminder, _popupButton, _popupPanel, _renderer, actionCommand, CLIENT_PROPERTY_HIDE_POPUP_ON_LIST_DATA_CHANGED, CLIENT_PROPERTY_TABLE_CELL_EDITOR, CLIENT_PROPERTY_TABLE_CELL_RENDERER, COMMIT, COMMIT_OR_RESET, COMMIT_OR_REVERT, dataModel, DIALOG, DROPDOWN, HIDE_POPUP_KEY, PERSIST, PROPERTY_SELECTED_ITEM, RESET, REVERT, selectedItemReminder |
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 | |
---|---|
DateComboBox()
Constructs a new DateComboBox . |
|
DateComboBox(DateModel model)
Constructs a new DateComboBox with specified DateModel. |
Method Summary | |
---|---|
protected String |
convertElementToString(Object value,
Class clazz)
|
Calendar |
createCalendarInstance()
Creates a new Calendar instance that will be used internally. |
protected DateChooserPanel |
createDateChooserPanel()
Creates DateChooserPanel as popup component. |
AbstractComboBox.EditorComponent |
createEditorComponent()
Subclass should implement this method to create the actual editor component. |
PopupPanel |
createPopupComponent()
Creates the DateChoosrePanel. |
protected void |
customizePopup(JidePopup popup)
Customizes the JidePopup that is used to show the drop down. |
void |
dateModelChanged(DateModelEvent e)
This notification tells listeners the something changed in date model. |
protected boolean |
equals(Object object1,
Object object2)
Check if object1 is equal to object2. |
Calendar |
getCalendar()
Gets the Calendar object that is represented in this component. |
Date |
getDate()
Gets the Date object that is represented in this component. |
DateModel |
getDateModel()
Gets the DateModel. |
protected List<KeyStroke> |
getDelegateKeyStrokes()
Overrides to undelegate CTRL+PAGE_UP and CTRL+PAGE_DOWN |
DateFormat |
getFormat()
Gets the DateFormat that is used to renderer the label. |
String |
getTimeFormat()
Gets the time format for time spinner on DateChooserPanel. |
boolean |
isInvalidValueAllowed()
Checks if the invalid value is allowed. |
boolean |
isPopupVolatile()
Checks if the popup is volatile. |
boolean |
isShowNoneButton()
Checks if none button is visible. |
boolean |
isShowOKButton()
Checks if OK button is visible. |
boolean |
isShowTodayButton()
Checks if today button is visible. |
boolean |
isShowWeekNumbers()
Checks if the week of year panel is visible. |
boolean |
isTimeDisplayed()
Checks if the time is displayed. |
void |
popupMenuCanceled(PopupMenuEvent e)
|
void |
resetPopup()
Resets the popup. |
void |
setCalendar(Calendar calendar)
Sets the Date. |
void |
setDate(Date date)
Sets the Date. |
void |
setDateModel(DateModel dateModel)
Sets the DateModel. |
void |
setFormat(DateFormat format)
Sets the DateFormat. |
void |
setInvalidValueAllowed(boolean invalidValueAllowed)
Sets the flag if the invalid value is allowed to be entered into DateComboBox . |
void |
setLocale(Locale l)
|
void |
setSelectedItem(Object anObject,
boolean fireEvent)
Sets the selected item. |
void |
setSelectedItemWithoutValidation(Object anObject,
boolean fireEvent)
Sets the selected date. |
void |
setShowNoneButton(boolean showNoneButton)
Sets the none button visible. |
void |
setShowOKButton(boolean showOKButton)
Sets the OK button visible. |
void |
setShowTodayButton(boolean showTodayButton)
Sets the today button visible. |
void |
setShowWeekNumbers(boolean showWeekNumbers)
Sets the week of year panel visible. |
void |
setTimeDisplayed(boolean timeDisplayed)
Sets the timeDisplayed property. |
void |
setTimeFormat(String timeFormat)
Sets the format for the time spinner on DateChooserPanel. |
protected void |
updateDateFromEditorComponent()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public DateComboBox()
DateComboBox
.
public DateComboBox(DateModel model)
DateComboBox
with specified DateModel.
model
- the DateModel.Method Detail |
---|
public DateModel getDateModel()
public void setDateModel(DateModel dateModel)
dateModel
- the date modelpublic void dateModelChanged(DateModelEvent e)
DateModelListener
dateModelChanged
in interface DateModelListener
public AbstractComboBox.EditorComponent createEditorComponent()
AbstractComboBox
createEditorComponent
in class AbstractComboBox
public PopupPanel createPopupComponent()
DateChooserPanel dateChooserPanel = new DateChooserPanel(getDateModel(),
isShowTodayButton(),
isShowNoneButton(), isShowWeekNumbers(), getLocale());
dateChooserPanel.setTimeDisplayed(isTimeDisplayed());
dateChooserPanel.setShowOKButton(isShowOKButton());
return dateChooserPanel;
createPopupComponent
in class AbstractComboBox
createDateChooserPanel()
protected DateChooserPanel createDateChooserPanel()
return new DateChooserPanel(getDateModel(), isShowTodayButton(), isShowNoneButton(), isShowWeekNumbers(), getLocale());
public boolean isPopupVolatile()
AbstractComboBox
isPopupVolatile
in class AbstractComboBox
public void popupMenuCanceled(PopupMenuEvent e)
popupMenuCanceled
in interface PopupMenuListener
popupMenuCanceled
in class AbstractComboBox
public Date getDate()
public void setSelectedItemWithoutValidation(Object anObject, boolean fireEvent)
setSelectedItem(Object,boolean)
does.
anObject
- the new datefireEvent
- true to fire event. False to not to fire event.protected boolean equals(Object object1, Object object2)
AbstractComboBox
equals
in class AbstractComboBox
object1
- one of the two objectsobject2
- another one of the two objects
public void setSelectedItem(Object anObject, boolean fireEvent)
setSelectedItem
in class AbstractComboBox
anObject
- the new datefireEvent
- true to fire event. False to not to fire event.setSelectedItemWithoutValidation(Object, boolean)
public Calendar createCalendarInstance()
protected void updateDateFromEditorComponent()
public Calendar getCalendar()
public void setDate(Date date)
date
- the datepublic void setCalendar(Calendar calendar)
calendar
- the calendarprotected String convertElementToString(Object value, Class clazz)
public DateFormat getFormat()
public void setFormat(DateFormat format)
setCalendar(java.util.Calendar)
method. Otherwise, the Calendar value you set will
be converted using the old format. Here is the right order to display time value in DateComboBox.
DateComboBox dateBox = new DateComboBox();
dateBox.setTimeDisplayed(true);
dateBox.setFormat(DateFormat.getDateTimeInstance()); // call this before setCalendar.
dateBox.setCalendar(cal);
format
- the date formatpublic boolean isShowTodayButton()
public void setShowTodayButton(boolean showTodayButton)
showTodayButton
- the flagpublic boolean isShowNoneButton()
public void setShowNoneButton(boolean showNoneButton)
showNoneButton
- the flagpublic boolean isShowOKButton()
public void setShowOKButton(boolean showOKButton)
setTimeDisplayed(boolean)
is also set to true.
showOKButton
- the flagpublic boolean isShowWeekNumbers()
public void setShowWeekNumbers(boolean showWeekNumbers)
showWeekNumbers
- the flagprotected List<KeyStroke> getDelegateKeyStrokes()
getDelegateKeyStrokes
in class AbstractComboBox
public boolean isTimeDisplayed()
public void setTimeDisplayed(boolean timeDisplayed)
timeDisplayed
- the flagpublic String getTimeFormat()
public void setTimeFormat(String timeFormat)
SimpleDateFormat
for the specification of format. Please also note this time format is not for what to
be displayed in the combobox itself. The format that controls what is displayed in the combobox is setFormat(java.text.DateFormat)
.
timeFormat
- the flagpublic void setLocale(Locale l)
setLocale
in class Component
public void resetPopup()
AbstractComboBox
resetPopup
in class AbstractComboBox
public boolean isInvalidValueAllowed()
public void setInvalidValueAllowed(boolean invalidValueAllowed)
DateComboBox
. If false (the default
value), user must type a valid date string in the correct format. Otherwise, the focus lost or after enter is
pressed, the invalid value will be reset. If true, the invalid string will be kept and set to the combobox using
setSelectedItem. Developer can use getSelectedItem to retrieve the value. getDate or getCalendar will still
return null as the value is not valid.
invalidValueAllowed
- true or false.protected void customizePopup(JidePopup popup)
AbstractComboBox
customizePopup
in class AbstractComboBox
popup
- the JidePopup.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |