home *** CD-ROM | disk | FTP | other *** search
- package javax.swing;
-
- import java.awt.Component;
- import java.util.EventObject;
- import javax.swing.table.TableCellEditor;
- import javax.swing.tree.TreeCellEditor;
-
- public class DefaultCellEditor extends AbstractCellEditor implements TableCellEditor, TreeCellEditor {
- protected JComponent editorComponent;
- protected EditorDelegate delegate;
- protected int clickCountToStart = 1;
-
- public DefaultCellEditor(JTextField var1) {
- this.editorComponent = var1;
- this.clickCountToStart = 2;
- this.delegate = new 1(this, var1);
- var1.addActionListener(this.delegate);
- }
-
- public DefaultCellEditor(JCheckBox var1) {
- this.editorComponent = var1;
- this.delegate = new 2(this, var1);
- ((AbstractButton)var1).addActionListener(this.delegate);
- }
-
- public DefaultCellEditor(JComboBox var1) {
- this.editorComponent = var1;
- ((JComponent)var1).putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight");
- this.delegate = new 3(this, var1);
- var1.addActionListener(this.delegate);
- }
-
- public Component getComponent() {
- return this.editorComponent;
- }
-
- public void setClickCountToStart(int var1) {
- this.clickCountToStart = var1;
- }
-
- public int getClickCountToStart() {
- return this.clickCountToStart;
- }
-
- public Object getCellEditorValue() {
- return this.delegate.getCellEditorValue();
- }
-
- public boolean isCellEditable(EventObject var1) {
- return this.delegate.isCellEditable(var1);
- }
-
- public boolean shouldSelectCell(EventObject var1) {
- return this.delegate.shouldSelectCell(var1);
- }
-
- public boolean stopCellEditing() {
- return this.delegate.stopCellEditing();
- }
-
- public void cancelCellEditing() {
- this.delegate.cancelCellEditing();
- }
-
- public Component getTreeCellEditorComponent(JTree var1, Object var2, boolean var3, boolean var4, boolean var5, int var6) {
- String var7 = var1.convertValueToText(var2, var3, var4, var5, var6, false);
- this.delegate.setValue(var7);
- return this.editorComponent;
- }
-
- public Component getTableCellEditorComponent(JTable var1, Object var2, boolean var3, int var4, int var5) {
- this.delegate.setValue(var2);
- return this.editorComponent;
- }
- }
-