JDatePicker v4.3

com.standbysoft.component.date.swing.plaf.basic
Class AbstractDateFieldUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended bycom.standbysoft.component.date.swing.plaf.DateUI
          extended bycom.standbysoft.component.date.swing.plaf.basic.AbstractDateFieldUI
Direct Known Subclasses:
BasicDateFieldUI

public abstract class AbstractDateFieldUI
extends DateUI

Defines the general structure that is used by subclasses to implement the actual UI delegate for JDateField. Such a delegate uses a simple text field to edit the date.

This UI delegate can be configured using the JDateEditComponent.clearOnEdit client property. 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.

 	JDateField dateField = new JDateField();
 	dateField.putClientProperty("JDateEditComponent.clearOnEdit", Boolean.TRUE);
 

See Also:
BasicDateFieldUI

Field Summary
protected  JDateField dateField
          Component for which this UI is registered.
protected  javax.swing.JTextField textField
          Text field that is used for editing.
 
Constructor Summary
AbstractDateFieldUI()
           
 
Method Summary
protected  java.lang.Object[] createDefaults()
          Creates a list of default values for some of the properties of JDateField.
protected abstract  java.awt.LayoutManager createLayout()
          Creates a LayoutManager that manages the text field used to edit the date.
protected abstract  javax.swing.JTextField createTextField()
          Creates the text field used to edit the date.
protected  void initializeDefaults()
          Registers the default values created for some of the properties of JDateField with the UIManager.
protected  void installComponents()
          Installs all the components needed by JDateField to implement its behavior.
protected  void installDefaults()
          Installs the default font and colors on the JDateField component.
protected  void installKeyboardActions()
          Registers all keyboard actions on the JDateField.
protected  void installListeners()
          Creates and installs the listeners for the date field.
 void installUI(javax.swing.JComponent c)
          Registers all the UI stuff needed to make the specified component work.
protected  void uninstallComponents()
          Uninstalls all registered components.
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
          Unregisters all keyboard actions on the JDateField.
protected  void uninstallListeners()
          Uninstalls the listeners from the date field.
 void uninstallUI(javax.swing.JComponent c)
          Unregisters all the UI stuff needed to make the specified component work.
protected abstract  void updateBackground()
          Updates the background color for the date field.
protected abstract  void updateEnabled()
          Updates the enabled state of the children components based on the enabled state of the JDateField.
protected abstract  void updateFont()
          Updates the font for the date field.
protected abstract  void updateForeground()
          Updates the foreground color for the date field.
protected abstract  void updateToolTipText()
          Updates the tooltip text for the date field.
 
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

dateField

protected JDateField dateField
Component for which this UI is registered.


textField

protected javax.swing.JTextField textField
Text field that is used for editing.

See Also:
createTextField()
Constructor Detail

AbstractDateFieldUI

public AbstractDateFieldUI()
Method Detail

createDefaults

protected java.lang.Object[] createDefaults()

Creates a list of default values for some of the properties of JDateField. 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:

  1. DateField.font
  2. DateField.foreground
  3. DateField.background
    1. Returns:
      a list of default values for some of the properties of JDateField
      See Also:
      initializeDefaults(), installDefaults()

initializeDefaults

protected void initializeDefaults()

Registers the default values created for some of the properties of JDateField with the UIManager.

See Also:
installDefaults()

installUI

public void installUI(javax.swing.JComponent c)
Registers all the UI stuff needed to make the specified component work. In other words, this is the place where the component's look and feel is created.

See Also:
installDefaults(), installComponents(), installListeners(), installKeyboardActions()

installDefaults

protected void installDefaults()
Installs the default font and colors on the JDateField component.


installComponents

protected void installComponents()
Installs all the components needed by JDateField to implement its behavior.

See Also:
createLayout(), createTextField()

createLayout

protected abstract java.awt.LayoutManager createLayout()
Creates a LayoutManager that manages the text field used to edit the date.

Returns:
a LayoutManager for the date field.

createTextField

protected abstract javax.swing.JTextField createTextField()
Creates the text field used to edit the date.

Returns:
text field used to edit the date.

installListeners

protected void installListeners()
Creates and installs the listeners for the date field. This method is called when the UI is installed.


installKeyboardActions

protected void installKeyboardActions()
Registers all keyboard actions on the JDateField.


uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Unregisters all the UI stuff needed to make the specified component work. In other words, this is the place where the component's look and feel is removed.

See Also:
uninstallKeyboardActions(), uninstallListeners(), uninstallComponents()

uninstallKeyboardActions

protected void uninstallKeyboardActions()
Unregisters all keyboard actions on the JDateField.


uninstallListeners

protected void uninstallListeners()
Uninstalls the listeners from the date field. This method is called when the UI is uninstalled.


uninstallDefaults

protected void uninstallDefaults()

uninstallComponents

protected void uninstallComponents()
Uninstalls all registered components. You should override this method if you extend this class and provide your own components.

See Also:
uninstallUI(JComponent)

updateEnabled

protected abstract void updateEnabled()
Updates the enabled state of the children components based on the enabled state of the JDateField.


updateFont

protected abstract void updateFont()
Updates the font for the date field.


updateForeground

protected abstract void updateForeground()
Updates the foreground color for the date field.


updateBackground

protected abstract void updateBackground()
Updates the background color for the date field.


updateToolTipText

protected abstract void updateToolTipText()
Updates the tooltip text for the date field.


JDatePicker v4.3

Visit www.jdatepicker.com for further information or send us your suggestions.

Copyright © 2003-2007 Stand By Soft Ltd. All Rights Reserved.