org.jdesktop.swingx.table
Class DatePickerCellEditor
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- org.jdesktop.swingx.table.DatePickerCellEditor
-
- All Implemented Interfaces:
- 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.TreeCellEditorA CellEditor using a JXDatePicker as editor component.NOTE: this class will be moved!
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DatePickerCellEditor()Instantiates a editor with the default dateFormat.DatePickerCellEditor(java.text.DateFormat dateFormat)Instantiates an editor with the given dateFormat.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.DategetCellEditorValue()Returns the pickers date.intgetClickCountToStart()Returns the number of clicks needed to start editing.java.text.DateFormat[]getFormats()java.awt.ComponentgetTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)java.awt.ComponentgetTreeCellEditorComponent(javax.swing.JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)booleanisCellEditable(java.util.EventObject anEvent)voidsetClickCountToStart(int count)Specifies the number of clicks needed to start editing.voidsetFormats(java.text.DateFormat... formats)booleanstopCellEditing()-
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, getCellEditorListeners, removeCellEditorListener, shouldSelectCell
-
-
-
-
Constructor Detail
-
DatePickerCellEditor
public DatePickerCellEditor()
Instantiates a editor with the default dateFormat. PENDING: always override default from DatePicker?
-
DatePickerCellEditor
public DatePickerCellEditor(java.text.DateFormat dateFormat)
Instantiates an editor with the given dateFormat. If null, the datePickers default is used.- Parameters:
dateFormat-
-
-
Method Detail
-
getCellEditorValue
public java.util.Date getCellEditorValue()
Returns the pickers date. Note: the date is only meaningful after a stopEditing and before the next call to getTableCellEditorComponent.- Specified by:
getCellEditorValuein interfacejavax.swing.CellEditor
-
isCellEditable
public boolean isCellEditable(java.util.EventObject anEvent)
- Specified by:
isCellEditablein interfacejavax.swing.CellEditor- Overrides:
isCellEditablein classjavax.swing.AbstractCellEditor
-
stopCellEditing
public boolean stopCellEditing()
Overridden to commit pending edits. If commit successful, returns super, else returns false.
- Specified by:
stopCellEditingin interfacejavax.swing.CellEditor- Overrides:
stopCellEditingin classjavax.swing.AbstractCellEditor
-
setClickCountToStart
public void setClickCountToStart(int count)
Specifies the number of clicks needed to start editing.- Parameters:
count- an int specifying the number of clicks needed to start editing- See Also:
getClickCountToStart()
-
getClickCountToStart
public int getClickCountToStart()
Returns the number of clicks needed to start editing.- Returns:
- the number of clicks needed to start editing
-
getTableCellEditorComponent
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)- Specified by:
getTableCellEditorComponentin interfacejavax.swing.table.TableCellEditor
-
getTreeCellEditorComponent
public java.awt.Component getTreeCellEditorComponent(javax.swing.JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)- Specified by:
getTreeCellEditorComponentin interfacejavax.swing.tree.TreeCellEditor
-
getFormats
public java.text.DateFormat[] getFormats()
- Returns:
- the DatePicker's formats.
- See Also:
JXDatePicker.getFormats().
-
setFormats
public void setFormats(java.text.DateFormat... formats)
- Parameters:
formats- the formats to use in the datepicker.- See Also:
JXDatePicker.setFormats(DateFormat...)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG