|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.editors.DateEditor
public class DateEditor
An editor for table and tree cells that handles the editing of Date objects.
Field Summary | |
---|---|
protected ChangeEvent |
changeEvent
The ChangeEvent fired when editing is stopped or canceled. |
protected Date |
currentDate
the date selected |
protected JDateChooser |
dateChooser
the date chooser component |
protected JDialog |
dialog
the dialog component |
protected EventListenerList |
listenerList
The listenerlist of CellEditorListeners. |
protected boolean |
selectCurrentDateIfNull
flag that indicates whether the current date should be selected when showing the date dialog, if there is no selection date. |
Constructor Summary | |
---|---|
DateEditor()
Constructs a DateEditor object that uses a Dialog component to edit dates. |
Method Summary | |
---|---|
void |
addCellEditorListener(CellEditorListener l)
Adds a CellEditorListener to the listener list. |
void |
cancelCellEditing()
Tells the editor to cancel editing and not accept any partially edited value. |
protected void |
fireEditingCanceled()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireEditingStopped()
Notifies all listeners that have registered interest for notification on this event type. |
Object |
getCellEditorValue()
Returns the value contained in the editor. |
JDateChooser |
getDateChooser()
Returns the date chooser that is shown to the user. |
boolean |
getSelectCurrentDateIfNull()
Determines whether to select the current date when the date chooser is displayed, if the selected date is null. |
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
Implementation of the one method defined by TableCellEditor. |
boolean |
isCellEditable(EventObject e)
Returns true. |
void |
removeCellEditorListener(CellEditorListener l)
Removes a CellEditorListener from the listener list. |
void |
setSelectCurrentDateIfNull(boolean selectCurrentDateIfNull)
Determines whether to select the current date when the date chooser is displayed, if the selected date is null. |
boolean |
shouldSelectCell(EventObject anEvent)
Returns true. |
boolean |
stopCellEditing()
Calls fireEditingStopped and returns true. |
void |
updateUI()
Updates the DateEditor's dialog UI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Date currentDate
protected JDialog dialog
protected JDateChooser dateChooser
protected boolean selectCurrentDateIfNull
protected EventListenerList listenerList
protected transient ChangeEvent changeEvent
Constructor Detail |
---|
public DateEditor()
Method Detail |
---|
public void addCellEditorListener(CellEditorListener l)
CellEditorListener
to the listener list.
addCellEditorListener
in interface CellEditor
l
- the new listener to be addedpublic void cancelCellEditing()
cancelCellEditing
in interface CellEditor
protected void fireEditingCanceled()
EventListenerList
protected void fireEditingStopped()
EventListenerList
public Object getCellEditorValue()
getCellEditorValue
in interface CellEditor
public JDateChooser getDateChooser()
public boolean getSelectCurrentDateIfNull()
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
table
- the JTable
that is asking the
editor to edit; can be null
value
- the value of the cell to be edited; it is
up to the specific editor to interpret
and draw the value. For example, if value is
the string "true", it could be rendered as a
string or it could be rendered as a check
box that is checked. null
is a valid valueisSelected
- true if the cell is to be rendered with
highlightingrow
- the row of the cell being editedcolumn
- the column of the cell being edited
public boolean isCellEditable(EventObject e)
isCellEditable
in interface CellEditor
e
- an event object
CellEditor.shouldSelectCell(java.util.EventObject)
public void removeCellEditorListener(CellEditorListener l)
CellEditorListener
from the listener list.
removeCellEditorListener
in interface CellEditor
l
- the listener to be removedpublic void setSelectCurrentDateIfNull(boolean selectCurrentDateIfNull)
selectCurrentDateIfNull
- true, if the current date is to be set, false otherwisepublic boolean shouldSelectCell(EventObject anEvent)
shouldSelectCell
in interface CellEditor
anEvent
- an event object
CellEditor.isCellEditable(java.util.EventObject)
public boolean stopCellEditing()
fireEditingStopped
and returns true.
stopCellEditing
in interface CellEditor
public void updateUI()
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |