mseries.ui
Class MDateCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
mseries.ui.MDateCellEditor
- All Implemented Interfaces:
- Serializable, CellEditor, TableCellEditor, TableCellRenderer
public class MDateCellEditor
- extends AbstractCellEditor
- implements TableCellEditor, TableCellRenderer
A simple example of MDateEntryField used as a table cell editor and table
cell renderer. It implements both interfaces but the same instance can
not be used as both the renderer and the editor. It is safest to use two
instances for each cell. As a renderer all the component gives is the
date formatting and the button which when clicked invokes the editor which
looks the same. A simple date formatting textfield would work equally well
as the renderer as Swing itself replaces the renderer with the editor when
the cell is clicked and vice-versa when editing is finished.
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
comp
public MDateEntryField comp
MDateCellEditor
public MDateCellEditor(DateFormat formatter)
- Constructs the editor using the date formatter passed.
- Parameters:
formatter - a DateFormat object to use for displaying the date
MDateCellEditor
public MDateCellEditor(String format)
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
- This method makes the component an editor
- Specified by:
getTableCellEditorComponent in interface TableCellEditor
getTableCellRendererComponent
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
- This method makes the component a renderer
- Specified by:
getTableCellRendererComponent in interface TableCellRenderer
getCellEditorValue
public Object getCellEditorValue()
- Specified by:
getCellEditorValue in interface CellEditor
configureEditor
protected void configureEditor()
- This method can be used to configure the MDateEntryField that is used
as the cell editor component. In the constructor this method is called
after the format is set and after border is nullified. Thus it
is best to only configure a constrainst object here and use it to
configure the editing field.
- See Also:
MDateEntryField,
MDateSelectorConstraints
setConstraints
public void setConstraints(MDateSelectorConstraints c)
- Passes the constraints object to the field that does the editing.
- Parameters:
c - a constraints object that can configure the pull down
Copyright © 2001-2007 M Newstead. All Rights Reserved.