blob: 48d8611cc24204b12c3188077bc3f672e7e2c0b6 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26package javax.swing.tree;
27
28import java.awt.Component;
29import javax.swing.CellEditor;
30import javax.swing.JTree;
31
32/**
33 * Adds to CellEditor the extensions necessary to configure an editor
34 * in a tree.
35 *
36 * @see javax.swing.JTree
37 *
38 * @author Scott Violet
39 */
40
41public interface TreeCellEditor extends CellEditor
42{
43 /**
44 * Sets an initial <I>value</I> for the editor. This will cause
45 * the editor to stopEditing and lose any partially edited value
46 * if the editor is editing when this method is called. <p>
47 *
48 * Returns the component that should be added to the client's
49 * Component hierarchy. Once installed in the client's hierarchy
50 * this component will then be able to draw and receive user input.
51 *
52 * @param tree the JTree that is asking the editor to edit;
53 * this parameter can be null
54 * @param value the value of the cell to be edited
55 * @param isSelected true if the cell is to be rendered with
56 * selection highlighting
57 * @param expanded true if the node is expanded
58 * @param leaf true if the node is a leaf node
59 * @param row the row index of the node being edited
60 * @return the component for editing
61 */
62 Component getTreeCellEditorComponent(JTree tree, Object value,
63 boolean isSelected, boolean expanded,
64 boolean leaf, int row);
65}