public class DatePickerCellEditor extends AbstractCellEditor implements TableCellEditor, TreeCellEditor
NOTE: this class will be moved!
Modifier and Type | Field and Description |
---|---|
protected int |
clickCountToStart |
protected DateFormat |
dateFormat |
protected JXDatePicker |
datePicker |
protected boolean |
ignoreAction |
private static Logger |
logger |
private ActionListener |
pickerActionListener |
private static long |
serialVersionUID |
changeEvent, listenerList
Constructor and Description |
---|
DatePickerCellEditor()
Instantiates a editor with the default dateFormat.
|
DatePickerCellEditor(DateFormat dateFormat)
Instantiates an editor with the given dateFormat.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
commitChange()
Commits any pending edits and returns a boolean indicating whether the
commit was successful.
|
protected ActionListener |
createPickerActionListener()
Creates and returns the ActionListener for the Picker.
|
Date |
getCellEditorValue()
Returns the pickers date.
|
int |
getClickCountToStart()
Returns the number of clicks needed to start editing.
|
DateFormat[] |
getFormats() |
protected ActionListener |
getPickerActionListener()
Returns the ActionListener to add to the datePicker.
|
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column) |
Component |
getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row) |
protected Date |
getValueAsDate(Object value)
Returns the given value as Date.
|
protected void |
handleParseException(ParseException e) |
boolean |
isCellEditable(EventObject anEvent) |
protected boolean |
isEmpty(Object value) |
void |
setClickCountToStart(int count)
Specifies the number of clicks needed to start editing.
|
void |
setFormats(DateFormat... formats) |
boolean |
stopCellEditing()
Overridden to commit pending edits.
|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCellEditorListener, cancelCellEditing, removeCellEditorListener, shouldSelectCell
protected JXDatePicker datePicker
protected DateFormat dateFormat
protected int clickCountToStart
private ActionListener pickerActionListener
protected boolean ignoreAction
private static final long serialVersionUID
public DatePickerCellEditor()
public DatePickerCellEditor(DateFormat dateFormat)
dateFormat
- public Date getCellEditorValue()
getCellEditorValue
in interface CellEditor
public boolean isCellEditable(EventObject anEvent)
isCellEditable
in interface CellEditor
isCellEditable
in class AbstractCellEditor
public boolean stopCellEditing()
Overridden to commit pending edits. If commit successful, returns super, else returns false.
stopCellEditing
in interface CellEditor
stopCellEditing
in class AbstractCellEditor
public void setClickCountToStart(int count)
count
- an int specifying the number of clicks needed to start
editinggetClickCountToStart()
public int getClickCountToStart()
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
getTreeCellEditorComponent
in interface TreeCellEditor
protected Date getValueAsDate(Object value)
value
- the value to map as Dateprotected void handleParseException(ParseException e)
e
- protected boolean commitChange()
public DateFormat[] getFormats()
JXDatePicker.getFormats().
public void setFormats(DateFormat... formats)
formats
- the formats to use in the datepicker.JXDatePicker.setFormats(DateFormat...)
protected ActionListener getPickerActionListener()
protected ActionListener createPickerActionListener()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses