KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > explorer > api > Tree


1 /*====================================================================
2
3 Objectweb Explorer Framework
4 Copyright (C) 2000-2005 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Moroy, Philippe Merle.
23 Contributor(s): ______________________________________.
24
25 ===================================================================
26 $Id: Tree.java,v 1.2 2005/07/06 15:36:01 moroy Exp $
27 ====================================================================*/

28
29 package org.objectweb.util.explorer.api;
30
31 import org.objectweb.fractal.api.Component;
32 import org.objectweb.util.explorer.swing.gui.api.TreeProvider;
33
34 /**
35  * Defines methods in order to populate and to manipulate the tree.
36  *
37  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jérôme Moroy</a>,
38  * <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>.
39  *
40  * @version 0.1
41  */

42 public interface Tree {
43
44     /** The name of the fractal interface reference. */
45     public static String JavaDoc TREE = "tree";
46
47     /** Fractal Interface name. */
48     public static String JavaDoc TREE_TMPL = "tree-tmpl";
49     
50     /** Fractal Interface name. */
51     public static String JavaDoc TREE_ITSELF = "tree-itself";
52         
53     /**
54      * Refresh all the tree.
55      */

56     public void
57     refreshAll();
58
59     /**
60      * Closes the tree.
61      * We suggest to call this method before closing the application based on this Tree.
62      */

63     public void
64     close();
65
66     /**
67      * Adds an object into the initial context.
68      *
69      * @param name Name of the object
70      * @param value The object to add
71      */

72     public void
73     addEntry(Object JavaDoc name, Object JavaDoc value);
74
75     /**
76      * Adds an object into the initial context and expands the node until a specific level if this one is a context.
77      *
78      * @param name Name of the object
79      * @param value The object to add
80      * @param level The level (>0 for a specific level or <0 for all levels)
81      */

82     public void
83     addEntry(Object JavaDoc name, Object JavaDoc value, int level);
84    
85     /**
86      * Selects the given path representation if it exists.
87      * Each node needs to be separated by the '/' character (i.e. elt1/elt2/elt3).
88      * @param path The representation of the path
89      */

90     public void
91     selectPath(String JavaDoc path);
92     
93     /**
94      * Refreshes the selected node name.
95      *
96      * @param odlName The old name.
97      * @param newName The new name.
98      */

99     public void
100     renameSelectedNode(Object JavaDoc odlName, Object JavaDoc newName);
101     
102     /**
103      * Removes the entry identified by the given name.
104      * This entry must be found within the InitialContext.
105      *
106      * @param name The name
107      */

108     public void
109     removeEntry(Object JavaDoc name);
110     
111     /**
112      * Renames the entry identified by the given name.
113      * This entry must be found within the InitialContext.
114      *
115      * @param currentName The current name of the entry.
116      * @param newName The new name.
117      */

118     public void
119     renameInitialEntry(Object JavaDoc currentName, Object JavaDoc newName);
120     
121     /**
122      * Removes all the entries contained within the InitialContext.
123      */

124     public void
125     clear();
126
127     /**
128      * Provides the number of entries contained within the InitialContext.
129      * @return The number of entries.
130      */

131     public int
132     getInitialContextSize();
133
134     /**
135      * Provides the selcted entry or null if no entry is selected.
136      * @return The selected entry.
137      */

138     public Entry
139     getSelectedEntry();
140     
141     /**
142      * Creates a new Tree instance with a same configuration of one contains in the explorer component.
143      * Equivalent to a <code>duplicate(true);</code> call.
144      * @return The new Tree instance.
145      * @see org.objectweb.util.explorer.api.Tree
146      * @see TreeProvider#duplicate(boolean)
147      */

148     public Component duplicate();
149
150     /**
151      * Creates a new Tree instance with a same configuration of one contains in the explorer component.
152      * @param withData A boolean to specify if the data of the source tree have to be added into the new one. The default value is "true"
153      * @return The new Tree instance.
154      * @see org.objectweb.util.explorer.api.Tree
155      */

156     public Component duplicate(boolean withData);
157     
158 }
159
Popular Tags