|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
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.klg.jclass.swing.JCPopupCalendar
JCPopupCalendar
is subclassed from JCComboBox
.
It uses a model with a single Date object in conjunction with a calendar
popup.
Note: This component can only be used with JDK 1.4 or later.
Nested Class Summary | |
protected class |
JCPopupCalendar.Bounds
This class is allows the DateEditor to make sure its value falls between any minimum or maximum specified on the popup calendar. |
class |
JCPopupCalendar.DateEditor
The default editor for the JCPopupCalendar. |
class |
JCPopupCalendar.DateRenderer
The default renderer for the JCPopupCalendar. |
Nested classes inherited from class javax.swing.JComboBox |
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected int |
calendarType
The type of calendar - either Date_TIME or DATE. |
static int |
DATE
Valid value for CalendarType . |
static int |
DATE_TIME
Valid value for CalendarType . |
protected DefaultComboBoxModel |
model
The current model. |
protected com.klg.jclass.swing.JCPopupCalendarEditor |
popupEditor
The current popup editor. |
protected boolean |
showPopupOnUpDownArrow
If true, and the user presses up or down arrow while in the editor, the calendar popup appears. |
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 | |
JCPopupCalendar()
Constructs a JCPopupCalendar of type DATE_TIME with the current
date and time and the default locale. |
|
JCPopupCalendar(Date d)
Constructs a JCPopupCalendar of type DATE_TIME with the supplied
date and the default locale. |
|
JCPopupCalendar(Date d,
Locale l)
Constructs a JCPopupCalendar of type DATE_TIME with the supplied
date and locale. |
|
JCPopupCalendar(int calendarType)
Constructs a JCPopupCalendar of the supplied calendarType with
the current date and the default locale. |
|
JCPopupCalendar(int calendarType,
Date d)
Constructs a JCPopupCalendar of the supplied calendarType with
the supplied date and the default locale. |
|
JCPopupCalendar(int calendarType,
Date d,
Locale l)
Constructs a JCPopupCalendar with the supplied date and locale. |
Method Summary | |
void |
changedUpdate(DocumentEvent e)
Gives notification that an attribute or set of attributes changed. |
protected Date |
extractCurrentEditorValue()
This returns the currently being edited value (possibly before a commit takes place) of the combo box editor. |
void |
focusGained(FocusEvent e)
Invoked when a component gains the keyboard focus. |
void |
focusLost(FocusEvent e)
Invoked when a component loses the keyboard focus. |
int |
getCalendarType()
Get the calendar type. |
static DateFormat |
getDefaultDateFormat(int type,
Locale l)
Given a calendar type and a locale, return the default date format that JCPopupCalendar uses. |
boolean |
getHidePopupOnDayTableClick()
Get whether the popup will popdown when the user selects a day on the day table. |
Date |
getMaximumDate()
Returns the maximum date. |
Date |
getMinimumDate()
Returns the minimum date. |
com.klg.jclass.swing.JCPopupCalendarEditor |
getPopupEditor()
Returns the popup editor. |
boolean |
getShowApplyButton()
Get whether an apply button be shown in the popup. |
boolean |
getShowPopupOnUpDownArrow()
Get whether the popup should appear when the user presses up or down arrow while in the editor. |
Date |
getValue()
Return the model's current value (stored as a Date object). |
protected ComboBoxUI |
inferLookAndFeelUI()
Return the appropriate ComboBoxUI object based on the Look and Feel. |
void |
insertUpdate(DocumentEvent event)
Gives notification that there was an insert into the document. |
void |
keyPressed(KeyEvent e)
Invoked when a key has been pressed. |
void |
keyReleased(KeyEvent e)
Invoked when a key has been released. |
void |
keyTyped(KeyEvent e)
Invoked when a key has been typed. |
static void |
main(String[] args)
Use for testing to provide a simple popup calendar within a frame. |
void |
propertyChange(PropertyChangeEvent e)
This method gets called when a bound property is changed. |
void |
removeUpdate(DocumentEvent e)
Gives notification that a portion of the document has been removed. |
void |
setCalendarType(int calendarType)
Set the calendar type. |
void |
setEditor(ComboBoxEditor anEditor)
Sets the editor used to paint and edit the selected item in the JCPopupCalendar . |
void |
setHidePopupOnDayTableClick(boolean hidePopupOnDayTableClick)
Set whether the popup will popdown when the user selects a day on the day table. |
void |
setLocale(Locale l)
Sets the locale being used by the popup calendar, which will set it on the popup editor and its child components, the editor, and the renderer. |
void |
setMaximumDate(Date maxDate)
Sets the maximum date. |
void |
setMinimumDate(Date minDate)
Sets the minimum date. |
void |
setPopupEditor(com.klg.jclass.swing.JCPopupCalendarEditor popup)
Sets the popup editor. |
void |
setShowApplyButton(boolean showApplyButton)
Set whether an apply button be shown in the popup. |
void |
setShowPopupOnUpDownArrow(boolean showPopupOnUpDownArrow)
Set whether the popup should appear when the user presses up or down arrow while in the editor. |
void |
setUI(ComboBoxUI ui)
Sets the look and feel for this component. |
void |
setValue(Date d)
Sets the value on the model as a Date object. |
protected void |
setValue(Date d,
boolean updatePopupEditor)
Sets the value on the model as a Date object. |
protected void |
updateComboBoxEditor(Date d)
Update the combo box editor with a new date. |
protected void |
updateComboBoxModel(Date d)
Update the combo box model with a new date. |
protected void |
updateComboBoxRenderer()
Update the combo box renderer (this gets done when the popup calendar). |
protected void |
updatePopupEditor(Date d)
Update the popup editor with a new date. |
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DATE_TIME
CalendarType
.
public static final int DATE
CalendarType
.
protected int calendarType
protected com.klg.jclass.swing.JCPopupCalendarEditor popupEditor
protected boolean showPopupOnUpDownArrow
protected DefaultComboBoxModel model
Constructor Detail |
public JCPopupCalendar()
JCPopupCalendar
of type DATE_TIME with the current
date and time and the default locale.
public JCPopupCalendar(int calendarType)
JCPopupCalendar
of the supplied calendarType with
the current date and the default locale.
calendarType
- The calendar type of the JCPopupCalendar. Must be one
of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE.public JCPopupCalendar(Date d)
JCPopupCalendar
of type DATE_TIME with the supplied
date and the default locale.
d
- The date to use for the calendar. If null, the current date and
time is used.public JCPopupCalendar(int calendarType, Date d)
JCPopupCalendar
of the supplied calendarType with
the supplied date and the default locale.
calendarType
- The calendar type of the JCPopupCalendar. Must be one
of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE.d
- The date to use for the calendar. If null, the current date and
time is used.public JCPopupCalendar(Date d, Locale l)
JCPopupCalendar
of type DATE_TIME with the supplied
date and locale.
d
- The date to use for the calendar. If null, the current date and
time is used.l
- The locale to use. If null, the default locale is used.public JCPopupCalendar(int calendarType, Date d, Locale l)
JCPopupCalendar
with the supplied date and locale.
calendarType
- The calendar type of the JCPopupCalendar. Must be one
of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE.d
- The date to use for the calendar. If null, the current date and
time is used.l
- The locale to use If null, the default locale is used.Method Detail |
protected ComboBoxUI inferLookAndFeelUI()
public void setPopupEditor(com.klg.jclass.swing.JCPopupCalendarEditor popup)
popup
- The new popup editorpublic com.klg.jclass.swing.JCPopupCalendarEditor getPopupEditor()
public void setValue(Date d)
d
- The new date value.protected void setValue(Date d, boolean updatePopupEditor)
d
- The new date value.updatePopupEditor
- If true, pass the new value on to the popup editor.public Date getValue()
public Date getMinimumDate()
public void setMinimumDate(Date minDate)
minDate
- The new minimum date.public Date getMaximumDate()
public void setMaximumDate(Date maxDate)
maxDate
- The new maximum date.public int getCalendarType()
public void setCalendarType(int calendarType)
calendarType
- The new calendarType. Must be one of
JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATEpublic boolean getShowPopupOnUpDownArrow()
public void setShowPopupOnUpDownArrow(boolean showPopupOnUpDownArrow)
showPopupOnUpDownArrow
- If true, and the user presses up or down arrow
while in the editor, the calendar popup appears.public boolean getHidePopupOnDayTableClick()
public void setHidePopupOnDayTableClick(boolean hidePopupOnDayTableClick)
hidePopupOnDayTableClick
- The new value of hidePopupOnDayTableClick. If
true, the popup will popdown when the user selects a day on the day table.public boolean getShowApplyButton()
public void setShowApplyButton(boolean showApplyButton)
showApplyButton
- The new value of showApplyButton. If true, an apply
button is shown in the popup.public void keyTyped(KeyEvent e)
KeyEvent
for a definition of
a key typed event.
keyTyped
in interface KeyListener
e
- The event generated by the key being typedpublic void keyPressed(KeyEvent e)
KeyEvent
for a definition of
a key pressed event.
keyPressed
in interface KeyListener
e
- The event generated by the keyPresspublic void keyReleased(KeyEvent e)
KeyEvent
for a definition of
a key released event.
keyReleased
in interface KeyListener
e
- The event generated by the keyReleasepublic void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
e
- A PropertyChangeEvent object describing the event source and the
property that has changed.public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
public void focusLost(FocusEvent e)
focusLost
in interface FocusListener
public void insertUpdate(DocumentEvent event)
insertUpdate
in interface DocumentListener
event
- The document eventpublic void removeUpdate(DocumentEvent e)
removeUpdate
in interface DocumentListener
e
- The document eventpublic void changedUpdate(DocumentEvent e)
changedUpdate
in interface DocumentListener
e
- The document eventprotected Date extractCurrentEditorValue()
protected void updateComboBoxEditor(Date d)
d
- The new dateprotected void updateComboBoxRenderer()
protected void updateComboBoxModel(Date d)
d
- The new dateprotected void updatePopupEditor(Date d)
d
- The new datepublic void setUI(ComboBoxUI ui)
setUI
in class JComboBox
ui
- The new Look and Feel object.public void updateUI()
updateUI
in class JComboBox
public void setLocale(Locale l)
setLocale
in class Component
l
- The new locale to be used.public void setEditor(ComboBoxEditor anEditor)
JCPopupCalendar
. The editor is used only if the
receiving JCPopupCalendar
is editable. If not editable,
the popup calendar uses the renderer to paint the selected item.
setEditor
in class JComboBox
anEditor
- The ComboBoxEditor
that displays the current
valueJComboBox.setRenderer(javax.swing.ListCellRenderer)
public static DateFormat getDefaultDateFormat(int type, Locale l)
type
- A calendar type. Must be one of JCPopupCalendar.DATE_TIME or
JCPopupCalendar.DATE.l
- The locale. If null, the default locale is used.
public static void main(String[] args)
args
- Command line args (ignored)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |