| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JComboBox comboBox = …;
DefaultCellEditor comboBoxEditor = new DefaultCellEditor(comboBox);
Based on 14 examples
public class DefaultCellEditor extends AbstractCellEditor implements TableCellEditor, TreeCellEditor
The default editor for table and tree cells.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see {@link java.beans.XMLEncoder}.
Nested Class Summary | |
---|---|
protected class |
The protected EditorDelegate class. |
Field Summary | |
---|---|
protected int |
clickCountToStart
An integer specifying the number of clicks needed to start editing. |
protected DefaultCellEditor.EditorDelegate |
delegate
The delegate class which handles all methods sent from the CellEditor . |
protected JComponent |
editorComponent
The Swing component being edited. |
Fields inherited from class javax.swing.AbstractCellEditor |
---|
changeEvent, listenerList |
Constructor Summary | |
---|---|
DefaultCellEditor(JCheckBox checkBox) Constructs a DefaultCellEditor object that uses a check box.
|
|
DefaultCellEditor(JComboBox comboBox) Constructs a DefaultCellEditor object that uses a
combo box.
|
|
DefaultCellEditor(JTextField textField) Constructs a DefaultCellEditor that uses a text field.
|
Method Summary | |
---|---|
void |
Forwards the message from the CellEditor to
the delegate .
|
Object |
Forwards the message from the CellEditor to
the delegate .
|
int |
Returns the number of clicks needed to start editing. |
Component |
Returns a reference to the editor component. |
Component |
getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) Implements the TableCellEditor interface.
|
Component |
getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) Implements the TreeCellEditor interface.
|
boolean |
isCellEditable(EventObject anEvent) Forwards the message from the CellEditor to
the delegate .
|
void |
setClickCountToStart(int count) Specifies the number of clicks needed to start editing. |
boolean |
shouldSelectCell(EventObject anEvent) Forwards the message from the CellEditor to
the delegate .
|
boolean |
Forwards the message from the CellEditor to
the delegate .
|
Methods inherited from class javax.swing.AbstractCellEditor |
---|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int clickCountToStart
clickCountToStart
is defined as zero, it
will not initiate until a click occurs.
protected DefaultCellEditor.EditorDelegate delegate
CellEditor
.
protected JComponent editorComponent
Constructor Detail |
---|
public DefaultCellEditor(JCheckBox checkBox)
DefaultCellEditor
object that uses a check box.
checkBox
- a JCheckBox
objectpublic DefaultCellEditor(JComboBox comboBox)
DefaultCellEditor
object that uses a
combo box.
comboBox
- a JComboBox
objectpublic DefaultCellEditor(JTextField textField)
DefaultCellEditor
that uses a text field.
textField
- a JTextField
objectMethod Detail |
---|
public void cancelCellEditing()
CellEditor
to
the delegate
.
cancelCellEditing
in class AbstractCellEditor
public Object getCellEditorValue()
CellEditor
to
the delegate
.
public int getClickCountToStart()
public Component getComponent()
Component
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
TableCellEditor
interface.
table
value
isSelected
row
column
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
TreeCellEditor
interface.
tree
value
isSelected
expanded
leaf
row
public boolean isCellEditable(EventObject anEvent)
CellEditor
to
the delegate
.
isCellEditable
in class AbstractCellEditor
anEvent
public void setClickCountToStart(int count)
count
- an int specifying the number of clicks needed to start editingpublic boolean shouldSelectCell(EventObject anEvent)
CellEditor
to
the delegate
.
shouldSelectCell
in class AbstractCellEditor
anEvent
public boolean stopCellEditing()
CellEditor
to
the delegate
.
stopCellEditing
in class AbstractCellEditor
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |