KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > schemas > view > views > wrappers > ITreeNode


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

20 package org.apache.directory.ldapstudio.schemas.view.views.wrappers;
21
22
23 import java.util.Collection JavaDoc;
24 import java.util.List JavaDoc;
25
26 import org.eclipse.swt.graphics.Image;
27
28
29 /**
30  * This interface defines an element that can be used in a TreeViewer.
31  *
32  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
33  * @version $Rev$, $Date$
34  */

35 public interface ITreeNode
36 {
37     /**
38      * Gets the image of the element.
39      *
40      * @return
41      * the image of the element
42      */

43     public Image getImage();
44
45
46     /**
47      * Gets the children of the element.
48      *
49      * @return
50      * the children of the element
51      */

52     public List JavaDoc<ITreeNode> getChildren();
53
54
55     /**
56      * Returns true if the element has children.
57      *
58      * @return
59      * true if the element has children
60      */

61     public boolean hasChildren();
62
63
64     /**
65      * Gets the parent of the element.
66      *
67      * @return
68      * the parent of the element
69      */

70     public ITreeNode getParent();
71
72
73     /**
74      * Sets the parent of the element.
75      *
76      * @param node
77      * the parent of the element
78      */

79     public void setParent( ITreeNode parent );
80
81
82     /**
83      * Adds a node to the element.
84      *
85      * @param node
86      * the node to add
87      */

88     public void addChild( ITreeNode node );
89
90
91     /**
92      * Removes a node from the element.
93      *
94      * @param node
95      * the node to remove
96      */

97     public void removeChild( ITreeNode node );
98
99
100     /**
101      * Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
102      *
103      * @param c
104      * the collection whose elements are to be added to this list.
105      * @return
106      * true if this list changed as a result of the call.
107      *
108      * @see java.util.List.addAll(Collection c)
109      */

110     public boolean addAllChildren( Collection JavaDoc<? extends ITreeNode> c );
111 }
112
Popular Tags