1. /*
  2. * @(#)TableCellEditor.java 1.13 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.table;
  11. import java.awt.Component;
  12. import javax.swing.CellEditor;
  13. import javax.swing.*;
  14. /**
  15. * This interface defines the method any object that would like to be
  16. * an editor of values for components such as <code>JListBox</code>,
  17. * <code>JComboBox</code>, <code>JTree</code>, or <code>JTable</code>
  18. * needs to implement.
  19. *
  20. * @version 1.13 02/02/00
  21. * @author Alan Chung
  22. */
  23. public interface TableCellEditor extends CellEditor {
  24. /**
  25. * Sets an initial <code>value</code> for the editor. This will cause
  26. * the editor to <code>stopEditing</code> and lose any partially
  27. * edited value if the editor is editing when this method is called. <p>
  28. *
  29. * Returns the component that should be added to the client's
  30. * <code>Component</code> hierarchy. Once installed in the client's
  31. * hierarchy this component will then be able to draw and receive
  32. * user input.
  33. *
  34. * @param table the <code>JTable</code> that is asking the
  35. * editor to edit; can be <code>null</code>
  36. * @param value the value of the cell to be edited; it is
  37. * up to the specific editor to interpret
  38. * and draw the value. For example, if value is
  39. * the string "true", it could be rendered as a
  40. * string or it could be rendered as a check
  41. * box that is checked. <code>null</code>
  42. * is a valid value
  43. * @param isSelected true if the cell is to be rendered with
  44. * highlighting
  45. * @param row the row of the cell being edited
  46. * @param column the column of the cell being edited
  47. * @return the component for editing
  48. */
  49. Component getTableCellEditorComponent(JTable table, Object value,
  50. boolean isSelected,
  51. int row, int column);
  52. }