JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing
Class JCPopupCalendar.DateEditor

java.lang.Object
  |
  +--com.klg.jclass.swing.JCPopupCalendar.DateEditor
All Implemented Interfaces:
ComboBoxEditor, Serializable
Enclosing class:
JCPopupCalendar

public class JCPopupCalendar.DateEditor
extends Object
implements ComboBoxEditor, Serializable

The default editor for the JCPopupCalendar.

See Also:
Serialized Form

Field Summary
protected  int calendarType
          The type of calendar - either Date_TIME or DATE.
protected  JFormattedTextField editor
          The editor component.
protected  com.klg.jclass.swing.JCPopupCalendar popupCalendar
          The parent popup calendar.
 
Constructor Summary
JCPopupCalendar.DateEditor(com.klg.jclass.swing.JCPopupCalendar popupCalendar, int calendarType, Date d)
          Create a DateEditor given its parent, the type of calendar, and an initial date.
JCPopupCalendar.DateEditor(com.klg.jclass.swing.JCPopupCalendar popupCalendar, int calendarType, Date d, Locale l)
          Create a DateEditor given its parent, the type of calendar, an initial date, and a locale.
 
Method Summary
 void addActionListener(ActionListener l)
          Add an ActionListener.
 int getCalendarType()
          Get the calendar type for the editor.
 Component getEditorComponent()
          Return the component that should be added to the tree hierarchy for this editor.
 Object getItem()
          Return the edited item which will be of type Date.
 com.klg.jclass.swing.JCPopupCalendar getPopupCalendar()
          Return the editor's JCPopupCalendar parent.
 void removeActionListener(ActionListener l)
          Remove an ActionListener.
 void selectAll()
          Ask the editor to start editing and to select everything.
 void setCalendarType(int calendarType)
          Set the calendarType on the editor.
 void setFormat(DateFormat df)
          The format to use for the editor.
 void setItem(Object anObject)
          Set the item that should be edited.
 void setLocale(Locale locale)
          Set the locale on the editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

popupCalendar

protected com.klg.jclass.swing.JCPopupCalendar popupCalendar
The parent popup calendar.


editor

protected JFormattedTextField editor
The editor component.


calendarType

protected int calendarType
The type of calendar - either Date_TIME or DATE.

Constructor Detail

JCPopupCalendar.DateEditor

public JCPopupCalendar.DateEditor(com.klg.jclass.swing.JCPopupCalendar popupCalendar,
                                  int calendarType,
                                  Date d)
Create a DateEditor given its parent, the type of calendar, and an initial date.

Parameters:
popupCalendar - The parent popup calendar
calendarType - The type of calendar. Must be one of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE
d - The initial date for the editor

JCPopupCalendar.DateEditor

public JCPopupCalendar.DateEditor(com.klg.jclass.swing.JCPopupCalendar popupCalendar,
                                  int calendarType,
                                  Date d,
                                  Locale l)
Create a DateEditor given its parent, the type of calendar, an initial date, and a locale.

Parameters:
popupCalendar - The parent popup calendar
calendarType - The type of calendar. Must be one of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE
d - The initial date for the editor
l - The locale to use
Method Detail

getPopupCalendar

public com.klg.jclass.swing.JCPopupCalendar getPopupCalendar()
Return the editor's JCPopupCalendar parent.

Returns:
The parent

getCalendarType

public int getCalendarType()
Get the calendar type for the editor. Will be one of JCPopupCalendar.DATE_TIME which means both the date and the time are shown or JCPopupCalendar.DATE which means only the date is shown.

Returns:
The current calendar type

setCalendarType

public void setCalendarType(int calendarType)
Set the calendarType on the editor. This method will also update the format of the editor to the default one for the new calendarType.

Parameters:
calendarType - The new calendarType. Must be one of JCPopupCalendar.DATE_TIME or JCPopupCalendar.DATE

setLocale

public void setLocale(Locale locale)
Set the locale on the editor. This method will also update the format of the editor to the default one for the new locale.

Parameters:
locale - The new locale

setFormat

public void setFormat(DateFormat df)
The format to use for the editor.

Parameters:
df - The new format

getEditorComponent

public Component getEditorComponent()
Return the component that should be added to the tree hierarchy for this editor.

Specified by:
getEditorComponent in interface ComboBoxEditor
Returns:
The editing component which is JFormattedTextField

setItem

public void setItem(Object anObject)
Set the item that should be edited. Cancel any editing if necessary.

Specified by:
setItem in interface ComboBoxEditor
Parameters:
anObject - The new item to be edited. It must be null or of type Date

getItem

public Object getItem()
Return the edited item which will be of type Date.

Specified by:
getItem in interface ComboBoxEditor
Returns:
The edited item

selectAll

public void selectAll()
Ask the editor to start editing and to select everything.

Specified by:
selectAll in interface ComboBoxEditor

addActionListener

public void addActionListener(ActionListener l)
Add an ActionListener. An action event is generated when the edited item changes

Specified by:
addActionListener in interface ComboBoxEditor
Parameters:
l - The action listener to be added

removeActionListener

public void removeActionListener(ActionListener l)
Remove an ActionListener.

Specified by:
removeActionListener in interface ComboBoxEditor
Parameters:
l - The action listener to be removed

Copyright © 2004 Quest Software Inc..
All rights reserved.