|
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.JComboBox com.jidesoft.combobox.ExComboBox com.jidesoft.combobox.DateExComboBox
public class DateExComboBox
DateComboBox
is a combobox which can be used to choose a Date
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jidesoft.combobox.ExComboBox |
---|
ExComboBox.LazyDelegateAction |
Nested classes/interfaces inherited from class javax.swing.JComboBox |
---|
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager |
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.ExComboBox |
---|
CLIENT_PROPERTY_HIDE_POPUP_ON_LIST_DATA_CHANGED, CLIENT_PROPERTY_POPUP_PANEL, CLIENT_PROPERTY_TABLE_CELL_EDITOR, CLIENT_PROPERTY_TABLE_CELL_RENDERER, COMMIT, COMMIT_OR_RESET, COMMIT_OR_REVERT, DIALOG, DOWN_KEY_BEHAVIOR_SELECT_NEXT, DOWN_KEY_BEHAVIOR_SHOW_POPUP, DROPDOWN, PERSIST, PROPERTY_BUTTON_VISIBLE, PROPERTY_SELECTED_ITEM, RESET, REVERT |
Fields inherited from class javax.swing.JComboBox |
---|
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, 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 | |
---|---|
DateExComboBox()
Constructs a new DateComboBox . |
|
DateExComboBox(DateModel model)
Constructs a new DateComboBox with specified DateModel. |
Method Summary | |
---|---|
String |
convertElementToString(Object value,
Class clazz)
|
Object |
convertStringToElement(String text,
Class clazz)
|
Calendar |
createCalendarInstance()
Creates a new Calendar instance that will be used internally. |
protected DateChooserPanel |
createDateChooserPanel()
Creates a DateChooserPanel instance used by DateExComboBox. |
PopupPanel |
createPopupComponent()
Creates the DateChoosrePanel. |
void |
customizePopup(JidePopup popup,
PopupPanel panel)
Customizes the popup and the popup panel before actually showing them. |
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. |
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 |
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 DateExComboBox()
DateComboBox
.
public DateExComboBox(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 PopupPanel createPopupComponent()
DateChooserPanel dateChooserPanel = new DateChooserPanel(getDateModel(),
isShowTodayButton(),
isShowNoneButton(), isShowWeekNumbers(), getLocale());
dateChooserPanel.setTimeDisplayed(isTimeDisplayed());
dateChooserPanel.setShowOKButton(isShowOKButton());
return dateChooserPanel;
createPopupComponent
in class ExComboBox
protected DateChooserPanel createDateChooserPanel()
public boolean isPopupVolatile()
ExComboBox
isPopupVolatile
in class ExComboBox
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)
ExComboBox
equals
in class ExComboBox
object1
- one of the two objectsobject2
- another one of the two objects
public void setSelectedItem(Object anObject, boolean fireEvent)
setSelectedItem
in class ExComboBox
anObject
- the new datefireEvent
- true to fire event. False to not to fire event.public Calendar createCalendarInstance()
protected void updateDateFromEditorComponent()
public Calendar getCalendar()
public void setDate(Date date)
date
- the datepublic void setCalendar(Calendar calendar)
calendar
- the calendarpublic String convertElementToString(Object value, Class clazz)
convertElementToString
in class ExComboBox
public Object convertStringToElement(String text, Class clazz)
convertStringToElement
in class ExComboBox
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 flagpublic List<KeyStroke> getDelegateKeyStrokes()
getDelegateKeyStrokes
in class ExComboBox
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 customizePopup(JidePopup popup, PopupPanel panel)
ExComboBox
customizePopup
in class ExComboBox
popup
- the JidePopuppanel
- the popup panelpublic void setLocale(Locale l)
setLocale
in class Component
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.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |