32 import java.awt.event.*;
33 import java.beans.BeanProperty;
34 import java.util.EventObject;
35
36 /**
37 * A <code>TreeCellEditor</code>. You need to supply an
38 * instance of <code>DefaultTreeCellRenderer</code>
39 * so that the icons can be obtained. You can optionally supply
40 * a <code>TreeCellEditor</code> that will be layed out according
41 * to the icon in the <code>DefaultTreeCellRenderer</code>.
42 * If you do not supply a <code>TreeCellEditor</code>,
43 * a <code>TextField</code> will be used. Editing is started
44 * on a triple mouse click, or after a click, pause, click and
45 * a delay of 1200 milliseconds.
46 *<p>
47 * <strong>Warning:</strong>
48 * Serialized objects of this class will not be compatible with
49 * future Swing releases. The current serialization support is
50 * appropriate for short term storage or RMI between applications running
51 * the same version of Swing. As of 1.4, support for long term storage
52 * of all JavaBeans™
53 * has been added to the <code>java.beans</code> package.
54 * Please see {@link java.beans.XMLEncoder}.
55 *
56 * @see javax.swing.JTree
57 *
58 * @author Scott Violet
59 */
60 public class DefaultTreeCellEditor implements ActionListener, TreeCellEditor,
61 TreeSelectionListener {
62 /** Editor handling the editing. */
63 protected TreeCellEditor realEditor;
64
65 /** Renderer, used to get border and offsets from. */
66 protected DefaultTreeCellRenderer renderer;
67
68 /** Editing container, will contain the <code>editorComponent</code>. */
69 protected Container editingContainer;
70
71 /**
72 * Component used in editing, obtained from the
|
32 import java.awt.event.*;
33 import java.beans.BeanProperty;
34 import java.util.EventObject;
35
36 /**
37 * A <code>TreeCellEditor</code>. You need to supply an
38 * instance of <code>DefaultTreeCellRenderer</code>
39 * so that the icons can be obtained. You can optionally supply
40 * a <code>TreeCellEditor</code> that will be layed out according
41 * to the icon in the <code>DefaultTreeCellRenderer</code>.
42 * If you do not supply a <code>TreeCellEditor</code>,
43 * a <code>TextField</code> will be used. Editing is started
44 * on a triple mouse click, or after a click, pause, click and
45 * a delay of 1200 milliseconds.
46 *<p>
47 * <strong>Warning:</strong>
48 * Serialized objects of this class will not be compatible with
49 * future Swing releases. The current serialization support is
50 * appropriate for short term storage or RMI between applications running
51 * the same version of Swing. As of 1.4, support for long term storage
52 * of all JavaBeans
53 * has been added to the <code>java.beans</code> package.
54 * Please see {@link java.beans.XMLEncoder}.
55 *
56 * @see javax.swing.JTree
57 *
58 * @author Scott Violet
59 */
60 public class DefaultTreeCellEditor implements ActionListener, TreeCellEditor,
61 TreeSelectionListener {
62 /** Editor handling the editing. */
63 protected TreeCellEditor realEditor;
64
65 /** Renderer, used to get border and offsets from. */
66 protected DefaultTreeCellRenderer renderer;
67
68 /** Editing container, will contain the <code>editorComponent</code>. */
69 protected Container editingContainer;
70
71 /**
72 * Component used in editing, obtained from the
|