public class DefaultCellEditor extends AbstractCellEditor implements TableCellEditor, TreeCellEditor
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans包。请看XMLEncoder。
| Modifier and Type | Class and Description |
|---|---|
protected class |
DefaultCellEditor.EditorDelegate
保护
EditorDelegate类。
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
clickCountToStart
一个整数,指定需要开始编辑的点击数。
|
protected DefaultCellEditor.EditorDelegate |
delegate
委托类处理所有的方法从
CellEditor派。
|
protected JComponent |
editorComponent
正在编辑的摆动组件。
|
changeEvent, listenerList| Constructor and Description |
|---|
DefaultCellEditor(JCheckBox checkBox)
构建了一个
DefaultCellEditor对象使用复选框。
|
DefaultCellEditor(JComboBox comboBox)
构建了一个
DefaultCellEditor对象使用组合框。
|
DefaultCellEditor(JTextField textField)
构建了一个
DefaultCellEditor使用文本字段。
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelCellEditing()
将消息从
CellEditor的
delegate。
|
Object |
getCellEditorValue()
将消息从
CellEditor的
delegate。
|
int |
getClickCountToStart()
返回启动编辑所需的单击次数。
|
Component |
getComponent()
返回编辑器组件的引用。
|
Component |
getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
实现了
TableCellEditor接口。
|
Component |
getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
实现了
TreeCellEditor接口。
|
boolean |
isCellEditable(EventObject anEvent)
将消息从
CellEditor的
delegate。
|
void |
setClickCountToStart(int count)
指定开始编辑所需的单击次数。
|
boolean |
shouldSelectCell(EventObject anEvent)
将消息从
CellEditor的
delegate。
|
boolean |
stopCellEditing()
将消息从
CellEditor的
delegate。
|
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCellEditorListener, removeCellEditorListenerprotected JComponent editorComponent
protected DefaultCellEditor.EditorDelegate delegate
CellEditor派。
protected int clickCountToStart
clickCountToStart定义为零,它不会开始直到发生单击。
@ConstructorProperties(value="component") public DefaultCellEditor(JTextField textField)
DefaultCellEditor使用文本字段。
textField -
JTextField对象
public DefaultCellEditor(JCheckBox checkBox)
DefaultCellEditor对象使用复选框。
checkBox -
JCheckBox对象
public DefaultCellEditor(JComboBox comboBox)
DefaultCellEditor对象使用组合框。
comboBox -
JComboBox对象
public Component getComponent()
Component
public void setClickCountToStart(int count)
count指定需要开始编辑点击数int
getClickCountToStart()
public int getClickCountToStart()
public Object getCellEditorValue()
CellEditor的
delegate。
getCellEditorValue 接口
CellEditor
DefaultCellEditor.EditorDelegate.getCellEditorValue()
public boolean isCellEditable(EventObject anEvent)
CellEditor的
delegate。
isCellEditable 接口
CellEditor
isCellEditable 方法重写,继承类
AbstractCellEditor
anEvent -一个事件对象
DefaultCellEditor.EditorDelegate.isCellEditable(EventObject)
public boolean shouldSelectCell(EventObject anEvent)
CellEditor的
delegate。
shouldSelectCell 接口
CellEditor
shouldSelectCell 方法重写,继承类
AbstractCellEditor
anEvent -一个事件对象
DefaultCellEditor.EditorDelegate.shouldSelectCell(EventObject)
public boolean stopCellEditing()
CellEditor的
delegate。
stopCellEditing 接口
CellEditor
stopCellEditing 方法重写,继承类
AbstractCellEditor
DefaultCellEditor.EditorDelegate.stopCellEditing()
public void cancelCellEditing()
CellEditor的
delegate。
cancelCellEditing 接口
CellEditor
cancelCellEditing 方法重写,继承类
AbstractCellEditor
DefaultCellEditor.EditorDelegate.cancelCellEditing()
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
TreeCellEditor接口。
getTreeCellEditorComponent 接口
TreeCellEditor
tree的JTree,要求编辑器来编辑此参数可以为空;
value -细胞要编辑的价值
isSelected -如果细胞是呈现高亮显示选择
expanded -如果节点展开
leaf -如果节点是叶节点
row -节点正在编辑的行的索引
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
TableCellEditor接口。
getTableCellEditorComponent 接口
TableCellEditor
table -
JTable,要求编辑器编辑;可以
null
value -细胞要编辑的价值;它是由特定的编辑器来解释和画的价值。例如,如果值是字符串“真”,它可以被渲染为一个字符串,或者它可以被渲染为一个检查框。
null是一个有效值
isSelected -如果细胞变得突出
row -正在编辑的单元格的行
column -正在编辑的单元格的列
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.