KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > tags > tree > ITreeRootElement


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.tags.tree;
19
20 import org.apache.beehive.netui.pageflow.requeststate.INameable;
21
22 import javax.servlet.ServletRequest JavaDoc;
23
24 /**
25  * This interface provides additional behavior on the root node in a tree. There
26  * are certain optimizations that may be done if state is tracked in the root.
27  * In addition, there are a number of features that are only applied to the root
28  * such as images. Finally, when the tree is run on the client, there are
29  * additonal features required of the root.
30  *
31  * This is a pretty simple interface to implement. Mostly the there are only
32  * properties that are stored for the additional state. The only method that
33  * is complicated is the <code>changeSelected</code> method.
34  */

35 public interface ITreeRootElement extends INameable
36 {
37     /**
38      * Change the node that is selected. This is an optimization were the
39      * root node can track which node is currently selected so it can unselect
40      * that node instead of searching the whole tree to find the selected node.
41      *
42      * There is a helper method <code>TreeHelpers.changeSelected</code> that can
43      * be used for delegation. This requires the root, the currently selected node,
44      * and will return the newly selected node.
45      * @param selectNode a String value name of the new node selected
46      * @param request the ServletRequest.
47      */

48     void changeSelected(String JavaDoc selectNode, ServletRequest JavaDoc request);
49
50     /**
51      * Return the currently selected <code>TreeElement</code>. This method
52      * will return null if no element is currently selected.
53      * @return the currently selected node.
54      */

55     TreeElement getSelectedNode();
56
57     /**
58      * return the TreeRenderState for this tree.
59      * @return TreeRenderState
60      */

61     TreeRenderState getTreeRenderState();
62
63     /**
64      * Set the TreeRenderState
65      * @param trs
66      */

67     void setTreeRenderState(TreeRenderState trs);
68
69     /**
70      * Property that returns the InheritableState that was set on the Tree.
71      * @return InheritableState
72      */

73     InheritableState getInheritableState();
74
75     /**
76      * Property that sets the InheritableState that is set on the Tree tag.
77      * @param state
78      */

79     void setInheritableState(InheritableState state);
80
81     /**
82      * @return String
83      */

84     String JavaDoc getRootNodeExpandedImage();
85
86     /**
87      * @param rootNodeExpandedImage
88      */

89     void setRootNodeExpandedImage(String JavaDoc rootNodeExpandedImage);
90
91     /**
92      * @return String
93      */

94     String JavaDoc getRootNodeCollapsedImage();
95
96     /**
97      * @param rootNodeCollapsedImage
98      */

99     void setRootNodeCollapsedImage(String JavaDoc rootNodeCollapsedImage);
100 }
101
Popular Tags