KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > forms > formmodel > ContainerWidget


1 /*
2  * Copyright 1999-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 package org.apache.cocoon.forms.formmodel;
17
18 import java.util.Iterator JavaDoc;
19
20 /**
21  * Interface to be implemented by Widgets which contain other widgets. So all
22  * widgets together form a widget tree, with its root being the {@link Form}
23  * widget, the {@link ContainerWidget}s being the branches/forks, and the
24  * {@link Widget}s with values being the leaves.
25  *
26  * @version $Id: ContainerWidget.java 180096 2005-06-05 14:36:02Z reinhard $
27  */

28 public interface ContainerWidget extends Widget {
29     
30     /**
31      * Adds a child widget.
32      */

33     public void addChild(Widget widget);
34     //TODO: check to remove since we have no removeChild
35

36
37     /**
38      * Checks if there is a child widget with the given id.
39      */

40     public boolean hasChild(String JavaDoc id);
41
42     /**
43      * Gets the child widget with the given id.
44      * @return null if there is no child with the given id.
45      */

46     public Widget getChild(String JavaDoc id);
47
48     /**
49      * @return an iterator over the widgets this object contains
50      */

51     public Iterator JavaDoc getChildren();
52
53 }
54
Popular Tags