1. /*
  2. * @(#)TreeCellEditor.java 1.8 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.tree;
  8. import java.awt.Component;
  9. import javax.swing.CellEditor;
  10. import javax.swing.JTree;
  11. /**
  12. * Adds to CellEditor the extensions necessary to configure an editor
  13. * in a tree.
  14. *
  15. * @version 1.8 11/29/01
  16. * @author Scott Violet
  17. */
  18. public interface TreeCellEditor extends CellEditor
  19. {
  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 JTree that is asking the editor to edit
  30. * This parameter can be null.
  31. * @param value the value of the cell to be edited.
  32. * @param isSelected true is the cell is to be renderer with
  33. * selection highlighting
  34. * @param expanded true if the node is expanded
  35. * @param leaf true if the node is a leaf node
  36. * @param row the row index of the node being edited
  37. * @return the component for editing
  38. */
  39. Component getTreeCellEditorComponent(JTree tree, Object value,
  40. boolean isSelected, boolean expanded,
  41. boolean leaf, int row);
  42. }