|
JDatePicker v4.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
com.standbysoft.component.date.swing.plaf.DateUI
com.standbysoft.component.date.swing.plaf.basic.AbstractDatePickerUI
Defines the general structure that is used by subclasses to implement the
actual UI delegate for JDatePicker.
It uses a simple combo box and a
calendar to select/edit a date.
This UI delegate can be configured using two client properties:
JDatePicker.backgroundOnEditable fixes a JComboBox
implementation bug. This UI delegate uses a JComboBox to represent the date picker. But
the combo box does not set the background color correctly when made
editable. So, we use this property to correct that. When this property
is configured with the Boolean.TRUE value, the combo box
background is also set on its editor component. By default, this property is not set.
JDatePicker datePicker = new JDatePicker();
datePicker.setEditable(true);
datePicker.putClientProperty("JDatePicker.backgroundOnEditable", Boolean.TRUE);
JDateEditComponent.clearOnEdit configures the editing behavior when the date picker is editable. If this property is set to Boolean.TRUE, the date is cleared when the user initiates an edit with the keyboard. But, if the user initiates an edit by clicking in the field with the mouse, the date is NOT cleared and the cursor is placed exactly where the user clicked. By default, this property is not set.
JDatePicker datePicker = new JDatePicker();
datePicker.setEditable(true);
datePicker.putClientProperty("JDateEditComponent.clearOnEdit", Boolean.TRUE);
BasicDatePickerUI| Field Summary | |
protected JComboBoxExt |
comboBox
Combo box used to create the date picker. |
protected JDatePicker |
datePicker
Component for which this UI is registered. |
protected JMonthView |
monthView
Calendar component used with the combo box to select dates. |
| Constructor Summary | |
AbstractDatePickerUI()
|
|
| Method Summary | |
protected abstract JComboBoxExt |
createComboBox()
Creates the combo box that is used by the date picker to select a date. |
protected java.lang.Object[] |
createDefaults()
Creates a list of default values for some of the properties of JDatePicker. |
protected abstract java.awt.LayoutManager |
createLayout()
Creates a LayoutManager that manages the combo box
used to select/edit the date. |
protected abstract JMonthView |
createMonthView()
Creates the calendar component that will be used by JDatePicker
to select a date. |
protected java.beans.PropertyChangeListener |
createPropertyChangeListener()
Creates a PropertyChangeListener that keeps track of the
changes in the JDatePicker component. |
protected void |
initializeDefaults()
Registers the default values created for some of the properties of JDatePicker with the UIManager. |
protected void |
installComponents()
Installs all the components needed by JDatePicker to implement
its behavior. |
protected void |
installDefaults()
Installs the default font and colors on the JDatePicker component. |
protected void |
installKeyboardActions()
|
protected void |
installListeners()
Creates and installs the listeners for the date picker. |
void |
installUI(javax.swing.JComponent c)
Registers all the UI stuff needed to make the specified component work. |
boolean |
isPopupVisible(JDatePicker c)
|
static void |
registerDateComboBoxUI(java.lang.String lf,
java.lang.Class ui)
Registers a ComboBoxUI object that also implements ComboBoxUIExt for
a specified look and feel. |
void |
setPopupVisible(JDatePicker c,
boolean v)
|
protected void |
uninstallComponents()
|
protected void |
uninstallDefaults()
|
protected void |
uninstallKeyboardActions()
|
protected void |
uninstallListeners()
Uninstalls the listeners from the date field. |
void |
uninstallUI(javax.swing.JComponent c)
|
static void |
unregisterDateComboBoxUI(java.lang.String lf)
Unregisters the ComboBoxUI object that also implements ComboBoxUIExt for
a specified look and feel. |
protected abstract void |
updateBackground()
Updates the background color for the supporting combo box. |
protected abstract void |
updateDateFormat()
|
protected abstract void |
updateDateSelectionModel()
Updates the selection model for the components of the date picker |
protected abstract void |
updateEditable()
Updates the editable state of the date picker components. |
protected abstract void |
updateEnabled()
Updates the enabled state of the children Components based on the enabled state of the JDatePicker. |
protected abstract void |
updateFont()
Updates the font for the date picker components. |
protected abstract void |
updateForeground()
Updates the foreground color for the supporting combo box. |
protected abstract void |
updateLocale()
Updates the locale for the date picker components. |
protected abstract void |
updateTimeZone()
Updates the time zone of the date picker component. |
protected abstract void |
updateToolTipText()
Updates the tooltip text for the date picker component. |
| Methods inherited from class javax.swing.plaf.ComponentUI |
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected JDatePicker datePicker
protected JComboBoxExt comboBox
protected JMonthView monthView
| Constructor Detail |
public AbstractDatePickerUI()
| Method Detail |
protected java.lang.Object[] createDefaults()
Creates a list of default values for some of the properties of
JDatePicker. These values are instances of objects that
implement the UIResource interface. For instance, default
fonts are created using the FontUIResource class while
colors using the ColorUIResource class.
The list is structured as follows: [key1, value1, key2, value2, ...] where the keys identify the properties and the values indicate the default values for these properties.
The keys returned in the list by this method are:
JDatePickerinitializeDefaults(),
installDefaults()protected void initializeDefaults()
Registers the default values created for some of the properties of
JDatePicker with the UIManager.
installDefaults()public void installUI(javax.swing.JComponent c)
installDefaults(),
installComponents(),
installListeners(),
installKeyboardActions()protected void installDefaults()
JDatePicker component.
protected void installComponents()
Installs all the components needed by JDatePicker to implement
its behavior.
createLayout(),
createMonthView(),
createComboBox()protected abstract java.awt.LayoutManager createLayout()
LayoutManager that manages the combo box
used to select/edit the date.
protected abstract JMonthView createMonthView()
Creates the calendar component that will be used by JDatePicker
to select a date. If you want to provide your own JMonthView
instance, keep in mind that its instance will be used by this delegate
so all operations should pass through the JDatePicker interface methods.
protected abstract JComboBoxExt createComboBox()
protected void installListeners()
protected java.beans.PropertyChangeListener createPropertyChangeListener()
PropertyChangeListener that keeps track of the
changes in the JDatePicker component. If this method returns
null then it will not be added to the date field.
PropertyChangeListener or null.protected void installKeyboardActions()
public void uninstallUI(javax.swing.JComponent c)
protected void uninstallDefaults()
protected void uninstallComponents()
protected void uninstallKeyboardActions()
protected void uninstallListeners()
public void setPopupVisible(JDatePicker c,
boolean v)
public boolean isPopupVisible(JDatePicker c)
protected abstract void updateEnabled()
JDatePicker.
protected abstract void updateFont()
protected abstract void updateDateSelectionModel()
protected abstract void updateLocale()
protected abstract void updateEditable()
protected abstract void updateTimeZone()
protected abstract void updateToolTipText()
protected abstract void updateForeground()
protected abstract void updateBackground()
protected abstract void updateDateFormat()
public static void registerDateComboBoxUI(java.lang.String lf,
java.lang.Class ui)
ComboBoxUI object that also implements ComboBoxUIExt for
a specified look and feel. The UI will be used by the date combobox to display the calendar.
lf - look and feel for which the ui is registered, com.sun.java.swing.plaf.motif.MotifLookAndFeel for instanceui - ComboBoxUI object associated with the look and feelpublic static void unregisterDateComboBoxUI(java.lang.String lf)
ComboBoxUI object that also implements ComboBoxUIExt for
a specified look and feel.
lf - look and feel for which the ui is registered, com.sun.java.swing.plaf.motif.MotifLookAndFeel for instance
|
JDatePicker v4.3 | |||||||||
| 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-2007 Stand By Soft Ltd. All Rights Reserved.