|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractCellEditor
javax.swing.DefaultCellEditor
public class DefaultCellEditor
The default implementation of TableCellEditor and
TreeCellEditor. It provides editor components for
some standard object types.
| Nested Class Summary | |
|---|---|
protected class |
DefaultCellEditor.EditorDelegate
This changeable module access the editor component in the component specific way. |
| Field Summary | |
|---|---|
protected int |
clickCountToStart
The number of the mouse clicks, required to start the editing session. |
protected DefaultCellEditor.EditorDelegate |
delegate
The editor delegate, responsible for listening the editorComponent
events and getting/setting its value. |
protected JComponent |
editorComponent
The Swing JComponent, performing the editing session. |
| Fields inherited from class javax.swing.AbstractCellEditor |
|---|
changeEvent, listenerList |
| Constructor Summary | |
|---|---|
DefaultCellEditor(JCheckBox checkbox)
Constructor DefaultCellEditor that uses the checkbox (appropriate for boolean values) |
|
DefaultCellEditor(JComboBox combobox)
Constructor DefaultCellEditor that uses the combo box. |
|
DefaultCellEditor(JTextField textfield)
Create the DefaultCellEditor that uses the text field as its editor component (appropriate for the text content) |
|
| Method Summary | |
|---|---|
void |
cancelCellEditing()
Forwards call to the delegate. |
Object |
getCellEditorValue()
Get the value, currently being displayed by the editor component. |
int |
getClickCountToStart()
Get the number of mouse clicks, required to start the editing session. |
Component |
getComponent()
Get the component that performs the editing sessions. |
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
Get the cell editor component that will perform the editing session. |
Component |
getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
Sets an initial value for the editor. |
boolean |
isCellEditable(EventObject event)
Forwards call to the delegate. |
void |
setClickCountToStart(int count)
Set the number of mouse clicks, required to start the editing session. |
boolean |
shouldSelectCell(EventObject event)
Forwards call to the delegate. |
boolean |
stopCellEditing()
Forwards call to the delegate. |
| Methods inherited from class javax.swing.AbstractCellEditor |
|---|
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener |
| 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, removeCellEditorListener |
| Field Detail |
|---|
protected JComponent editorComponent
protected DefaultCellEditor.EditorDelegate delegate
editorComponent
events and getting/setting its value.
protected int clickCountToStart
| Constructor Detail |
|---|
public DefaultCellEditor(JTextField textfield)
textfield - the text field as will be used as the editor componentpublic DefaultCellEditor(JCheckBox checkbox)
checkbox - the checkbox that will be used with this editor.public DefaultCellEditor(JComboBox combobox)
combobox - the combo box that will be used with this editor.| Method Detail |
|---|
public Component getComponent()
public int getClickCountToStart()
public void setClickCountToStart(int count)
count - the number of clicks, required to start the sessionpublic Object getCellEditorValue()
delegate.
getCellEditorValue in interface CellEditorpublic boolean isCellEditable(EventObject event)
delegate.
isCellEditable in interface CellEditorisCellEditable in class AbstractCellEditorevent - forwarded to the delegate.
public boolean shouldSelectCell(EventObject event)
delegate.
shouldSelectCell in interface CellEditorshouldSelectCell in class AbstractCellEditorevent - forwarded to the delegate.
public boolean stopCellEditing()
delegate.
stopCellEditing in interface CellEditorstopCellEditing in class AbstractCellEditorpublic void cancelCellEditing()
delegate.
cancelCellEditing in interface CellEditorcancelCellEditing in class AbstractCellEditor
public Component getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
getTreeCellEditorComponent in interface TreeCellEditortree - - 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
public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
getTableCellEditorComponent in interface TableCellEditortable - the table where the editing is performedvalue - the current value of the table. It is set as the initial
component value.isSelected - if true, the cell is currently selectedrow - the row of the cell being editedcolumn - the column of the cell being edited
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||