|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractCellEditor
org.jdesktop.swingx.table.DatePickerCellEditor
public class DatePickerCellEditor
A CellEditor using a JXDatePicker as editor component.
NOTE: this class will be moved!
Field Summary | |
---|---|
protected int |
clickCountToStart
|
protected DateFormat |
dateFormat
|
protected JXDatePicker |
datePicker
|
protected boolean |
ignoreAction
|
Fields inherited from class javax.swing.AbstractCellEditor |
---|
changeEvent, listenerList |
Constructor Summary | |
---|---|
DatePickerCellEditor()
Instantiates a editor with the default dateFormat. |
|
DatePickerCellEditor(DateFormat dateFormat)
Instantiates an editor with the given dateFormat. |
Method Summary | |
---|---|
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)
Sets an initial value for the editor. |
Component |
getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
Sets an initial value for the editor. |
protected Date |
getValueAsDate(Object value)
Returns the given value as Date. |
protected void |
handleParseException(ParseException e)
|
boolean |
isCellEditable(EventObject anEvent)
Returns true. |
protected boolean |
isEmpty(Object value)
|
void |
setClickCountToStart(int count)
Specifies the number of clicks needed to start editing. |
void |
setFormats(DateFormat... formats)
|
boolean |
stopCellEditing()
Calls fireEditingStopped and returns true. |
Methods inherited from class javax.swing.AbstractCellEditor |
---|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.CellEditor |
---|
addCellEditorListener, cancelCellEditing, removeCellEditorListener, shouldSelectCell |
Field Detail |
---|
protected JXDatePicker datePicker
protected DateFormat dateFormat
protected int clickCountToStart
protected boolean ignoreAction
Constructor Detail |
---|
public DatePickerCellEditor()
public DatePickerCellEditor(DateFormat dateFormat)
dateFormat
- Method Detail |
---|
public Date getCellEditorValue()
getCellEditorValue
in interface CellEditor
public boolean isCellEditable(EventObject anEvent)
javax.swing.AbstractCellEditor
isCellEditable
in interface CellEditor
isCellEditable
in class AbstractCellEditor
anEvent
- an event object
CellEditor.shouldSelectCell(java.util.EventObject)
public boolean stopCellEditing()
fireEditingStopped
and returns true.
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)
javax.swing.table.TableCellEditor
value
for the editor. This will cause
the editor to stopEditing
and lose any partially
edited value if the editor is editing when this method is called.
Returns the component that should be added to the client's
Component
hierarchy. Once installed in the client's
hierarchy this component will then be able to draw and receive
user input.
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 Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
javax.swing.tree.TreeCellEditor
Returns the component that should be added to the client's Component hierarchy. Once installed in the client's hierarchy this component will then be able to draw and receive user input.
getTreeCellEditorComponent
in interface TreeCellEditor
tree
- the JTree that is asking the editor to edit;
this parameter can be nullvalue
- the value of the cell to be editedisSelected
- true is the cell is to be renderer with
selection highlightingexpanded
- true if the node is expandedleaf
- true if the node is a leaf noderow
- the row index of the node being edited
protected Date getValueAsDate(Object value)
value
- the value to map as Date
protected void handleParseException(ParseException e)
e
- protected boolean isEmpty(Object value)
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |