java.io.Serializable
, javax.swing.CellEditor
, javax.swing.table.TableCellEditor
, javax.swing.tree.TreeCellEditor
public class DatePickerCellEditor
extends javax.swing.AbstractCellEditor
implements javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor
NOTE: this class will be moved!
Modifier and Type | Field | Description |
---|---|---|
protected int |
clickCountToStart |
|
protected java.text.DateFormat |
dateFormat |
|
protected JXDatePicker |
datePicker |
|
protected boolean |
ignoreAction |
Constructor | Description |
---|---|
DatePickerCellEditor() |
Instantiates a editor with the default dateFormat.
|
DatePickerCellEditor(java.text.DateFormat dateFormat) |
Instantiates an editor with the given dateFormat.
|
Modifier and Type | Method | Description |
---|---|---|
protected boolean |
commitChange() |
Commits any pending edits and returns a boolean indicating whether the
commit was successful.
|
protected java.awt.event.ActionListener |
createPickerActionListener() |
Creates and returns the ActionListener for the Picker.
|
java.util.Date |
getCellEditorValue() |
Returns the pickers date.
|
int |
getClickCountToStart() |
Returns the number of clicks needed to start editing.
|
java.text.DateFormat[] |
getFormats() |
|
protected java.awt.event.ActionListener |
getPickerActionListener() |
Returns the ActionListener to add to the datePicker.
|
java.awt.Component |
getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
int row,
int column) |
|
java.awt.Component |
getTreeCellEditorComponent(javax.swing.JTree tree,
java.lang.Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row) |
|
protected java.util.Date |
getValueAsDate(java.lang.Object value) |
Returns the given value as Date.
|
protected void |
handleParseException(java.text.ParseException e) |
|
boolean |
isCellEditable(java.util.EventObject anEvent) |
|
protected boolean |
isEmpty(java.lang.Object value) |
|
void |
setClickCountToStart(int count) |
Specifies the number of clicks needed to start editing.
|
void |
setFormats(java.text.DateFormat... formats) |
|
boolean |
stopCellEditing() |
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell
protected JXDatePicker datePicker
protected java.text.DateFormat dateFormat
protected int clickCountToStart
protected boolean ignoreAction
public DatePickerCellEditor()
public DatePickerCellEditor(java.text.DateFormat dateFormat)
dateFormat
- public java.util.Date getCellEditorValue()
getCellEditorValue
in interface javax.swing.CellEditor
public boolean isCellEditable(java.util.EventObject anEvent)
isCellEditable
in interface javax.swing.CellEditor
isCellEditable
in class javax.swing.AbstractCellEditor
public boolean stopCellEditing()
Overridden to commit pending edits. If commit successful, returns super, else returns false.
stopCellEditing
in interface javax.swing.CellEditor
stopCellEditing
in class javax.swing.AbstractCellEditor
public void setClickCountToStart(int count)
count
- an int specifying the number of clicks needed to start
editinggetClickCountToStart()
public int getClickCountToStart()
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface javax.swing.table.TableCellEditor
public java.awt.Component getTreeCellEditorComponent(javax.swing.JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
getTreeCellEditorComponent
in interface javax.swing.tree.TreeCellEditor
protected java.util.Date getValueAsDate(java.lang.Object value)
value
- the value to map as Dateprotected void handleParseException(java.text.ParseException e)
e
- protected boolean isEmpty(java.lang.Object value)
protected boolean commitChange()
public java.text.DateFormat[] getFormats()
public void setFormats(java.text.DateFormat... formats)
formats
- the formats to use in the datepicker.JXDatePicker.setFormats(DateFormat...)
protected java.awt.event.ActionListener getPickerActionListener()
protected java.awt.event.ActionListener createPickerActionListener()