1 /* 2 * @(#)TableCellEditor.java 1.16 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package javax.swing.table; 9 10 import java.awt.Component; 11 import javax.swing.CellEditor; 12 import javax.swing.*; 13 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.16 12/19/03 21 * @author Alan Chung 22 */ 23 24 25 public interface TableCellEditor extends CellEditor { 26 27 /** 28 * Sets an initial <code>value</code> for the editor. This will cause 29 * the editor to <code>stopEditing</code> and lose any partially 30 * edited value if the editor is editing when this method is called. <p> 31 * 32 * Returns the component that should be added to the client's 33 * <code>Component</code> hierarchy. Once installed in the client's 34 * hierarchy this component will then be able to draw and receive 35 * user input. 36 * 37 * @param table the <code>JTable</code> that is asking the 38 * editor to edit; can be <code>null</code> 39 * @param value the value of the cell to be edited; it is 40 * up to the specific editor to interpret 41 * and draw the value. For example, if value is 42 * the string "true", it could be rendered as a 43 * string or it could be rendered as a check 44 * box that is checked. <code>null</code> 45 * is a valid value 46 * @param isSelected true if the cell is to be rendered with 47 * highlighting 48 * @param row the row of the cell being edited 49 * @param column the column of the cell being edited 50 * @return the component for editing 51 */ 52 Component getTableCellEditorComponent(JTable table, Object value, 53 boolean isSelected, 54 int row, int column); 55 } 56 57