KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > model > SelectItemGroup


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 package javax.faces.model;
17
18 /**
19  * @author Thomas Spiegl (latest modification by $Author: mwessendorf $)
20  * @version $Revision: 1.5 $ $Date: 2004/07/01 22:01:10 $
21  * $Log: SelectItemGroup.java,v $
22  * Revision 1.5 2004/07/01 22:01:10 mwessendorf
23  * ASF switch
24  *
25  * Revision 1.4 2004/04/07 08:20:01 manolito
26  * EMPTY_SELECT_ITEMS
27  *
28  */

29 public class SelectItemGroup extends SelectItem
30 {
31     private static final SelectItem[] EMPTY_SELECT_ITEMS = new SelectItem[0];
32
33     // FIELDS
34
private SelectItem[] _selectItems;
35     
36     // CONSTRUCTORS
37
public SelectItemGroup()
38     {
39         super();
40         _selectItems = EMPTY_SELECT_ITEMS;
41     }
42
43     public SelectItemGroup(String JavaDoc label)
44     {
45         super("", label, null, false);
46         _selectItems = EMPTY_SELECT_ITEMS;
47     }
48
49     public SelectItemGroup(String JavaDoc label, String JavaDoc description, boolean disabled, SelectItem[] selectItems)
50     {
51         super("", label, description, disabled);
52         if (selectItems == null) throw new NullPointerException JavaDoc("selectItems");
53         _selectItems = selectItems;
54     }
55
56     // METHODS
57
public SelectItem[] getSelectItems()
58     {
59         return _selectItems;
60     }
61
62     public void setSelectItems(SelectItem[] selectItems)
63     {
64         if (selectItems == null) throw new NullPointerException JavaDoc("selectItems");
65         _selectItems = selectItems;
66     }
67 }
68
Popular Tags