01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: **/package org.araneaframework.uilib.tree;
16:
17: import java.io.Serializable;
18: import java.util.List;
19:
20: /**
21: * Tree data provider is used by {@link TreeWidget} to retrieve tree data.
22: *
23: * @author Alar Kvell (alar@araneaframework.org)
24: * @since 1.0.7
25: */
26: public interface TreeDataProvider extends Serializable {
27:
28: /**
29: * Returns a list of child nodes for specified parent node.
30: *
31: * @param parent
32: * tree node whose children will be returned. Root node of the tree
33: * ({@link TreeWidget}) has no display widget.
34: * @return list of {@link TreeNodeWidget}s. May return <code>null</code>
35: * instead of empty list.
36: */
37: List getChildren(TreeNodeContext parent);
38:
39: /**
40: * Returns if the specified tree node has any children.
41: *
42: * @param parent
43: * tree node which will be checked for existence of child nodes.
44: * @return if the specified tree node has any children.
45: */
46: boolean hasChildren(TreeNodeContext parent);
47:
48: }
|