1. /*
  2. * @(#)TreeCellEditor.java 1.13 03/01/23
  3. *
  4. * Copyright 2003 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. * @see javax.swing.JTree
  16. *
  17. * @version 1.13 01/23/03
  18. * @author Scott Violet
  19. */
  20. public interface TreeCellEditor extends CellEditor
  21. {
  22. /**
  23. * Sets an initial <I>value</I> for the editor. This will cause
  24. * the editor to stopEditing and lose any partially edited value
  25. * if the editor is editing when this method is called. <p>
  26. *
  27. * Returns the component that should be added to the client's
  28. * Component hierarchy. Once installed in the client's hierarchy
  29. * this component will then be able to draw and receive user input.
  30. *
  31. * @param tree the JTree that is asking the editor to edit;
  32. * this parameter can be null
  33. * @param value the value of the cell to be edited
  34. * @param isSelected true is the cell is to be renderer with
  35. * selection highlighting
  36. * @param expanded true if the node is expanded
  37. * @param leaf true if the node is a leaf node
  38. * @param row the row index of the node being edited
  39. * @return the component for editing
  40. */
  41. Component getTreeCellEditorComponent(JTree tree, Object value,
  42. boolean isSelected, boolean expanded,
  43. boolean leaf, int row);
  44. }