home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / DefaultCellEditor.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.4 KB  |  76 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.util.EventObject;
  5. import javax.swing.table.TableCellEditor;
  6. import javax.swing.tree.TreeCellEditor;
  7.  
  8. public class DefaultCellEditor extends AbstractCellEditor implements TableCellEditor, TreeCellEditor {
  9.    protected JComponent editorComponent;
  10.    protected EditorDelegate delegate;
  11.    protected int clickCountToStart = 1;
  12.  
  13.    public DefaultCellEditor(JTextField var1) {
  14.       this.editorComponent = var1;
  15.       this.clickCountToStart = 2;
  16.       this.delegate = new 1(this, var1);
  17.       var1.addActionListener(this.delegate);
  18.    }
  19.  
  20.    public DefaultCellEditor(JCheckBox var1) {
  21.       this.editorComponent = var1;
  22.       this.delegate = new 2(this, var1);
  23.       ((AbstractButton)var1).addActionListener(this.delegate);
  24.    }
  25.  
  26.    public DefaultCellEditor(JComboBox var1) {
  27.       this.editorComponent = var1;
  28.       ((JComponent)var1).putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight");
  29.       this.delegate = new 3(this, var1);
  30.       var1.addActionListener(this.delegate);
  31.    }
  32.  
  33.    public Component getComponent() {
  34.       return this.editorComponent;
  35.    }
  36.  
  37.    public void setClickCountToStart(int var1) {
  38.       this.clickCountToStart = var1;
  39.    }
  40.  
  41.    public int getClickCountToStart() {
  42.       return this.clickCountToStart;
  43.    }
  44.  
  45.    public Object getCellEditorValue() {
  46.       return this.delegate.getCellEditorValue();
  47.    }
  48.  
  49.    public boolean isCellEditable(EventObject var1) {
  50.       return this.delegate.isCellEditable(var1);
  51.    }
  52.  
  53.    public boolean shouldSelectCell(EventObject var1) {
  54.       return this.delegate.shouldSelectCell(var1);
  55.    }
  56.  
  57.    public boolean stopCellEditing() {
  58.       return this.delegate.stopCellEditing();
  59.    }
  60.  
  61.    public void cancelCellEditing() {
  62.       this.delegate.cancelCellEditing();
  63.    }
  64.  
  65.    public Component getTreeCellEditorComponent(JTree var1, Object var2, boolean var3, boolean var4, boolean var5, int var6) {
  66.       String var7 = var1.convertValueToText(var2, var3, var4, var5, var6, false);
  67.       this.delegate.setValue(var7);
  68.       return this.editorComponent;
  69.    }
  70.  
  71.    public Component getTableCellEditorComponent(JTable var1, Object var2, boolean var3, int var4, int var5) {
  72.       this.delegate.setValue(var2);
  73.       return this.editorComponent;
  74.    }
  75. }
  76.