1. /*
  2. * @(#)TableCellEditor.java 1.11 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.table;
  8. import java.awt.Component;
  9. import javax.swing.CellEditor;
  10. import javax.swing.*;
  11. /**
  12. * This interface defines the methods any object that would like to be
  13. * an editor of values for components such as ListBox, ComboBox, Tree, or
  14. * Table, etc.
  15. *
  16. * @version 1.11 11/29/01
  17. * @author Alan Chung
  18. */
  19. public interface TableCellEditor extends CellEditor {
  20. /**
  21. * Sets an initial <I>value</I> for the editor. This will cause
  22. * the editor to stopEditing and lose any partially edited value
  23. * if the editor is editing when this method is called. <p>
  24. *
  25. * Returns the component that should be added to the client's
  26. * Component hierarchy. Once installed in the client's hierarchy
  27. * this component will then be able to draw and receive user input.
  28. *
  29. * @param table the JTable that is asking the editor to edit
  30. * This parameter can be null.
  31. * @param value the value of the cell to be edited. It is
  32. * up to the specific editor to interpret
  33. * and draw the value. eg. if value is the
  34. * String "true", it could be rendered as a
  35. * string or it could be rendered as a check
  36. * box that is checked. null is a valid value.
  37. * @param isSelected true is the cell is to be renderer with
  38. * selection highlighting
  39. * @param row the row of the cell being edited
  40. * @param column the column of the cell being edited
  41. * @return the component for editing
  42. */
  43. Component getTableCellEditorComponent(JTable table, Object value,
  44. boolean isSelected,
  45. int row, int column);
  46. }