Source code: javax/faces/model/SelectItemGroup.java
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: bdudney $)
20 * @version $Revision: 225333 $ $Date: 2005-07-26 11:49:19 -0400 (Tue, 26 Jul 2005) $
21 */
22 public class SelectItemGroup extends SelectItem
23 {
24 private static final long serialVersionUID = 849845793056900213L;
25
26 private static final SelectItem[] EMPTY_SELECT_ITEMS = new SelectItem[0];
27
28 // FIELDS
29 private SelectItem[] _selectItems;
30
31 // CONSTRUCTORS
32 public SelectItemGroup()
33 {
34 super();
35 _selectItems = EMPTY_SELECT_ITEMS;
36 }
37
38 public SelectItemGroup(String label)
39 {
40 super("", label, null, false);
41 _selectItems = EMPTY_SELECT_ITEMS;
42 }
43
44 public SelectItemGroup(String label, String description, boolean disabled, SelectItem[] selectItems)
45 {
46 super("", label, description, disabled);
47 if (selectItems == null) throw new NullPointerException("selectItems");
48 _selectItems = selectItems;
49 }
50
51 // METHODS
52 public SelectItem[] getSelectItems()
53 {
54 return _selectItems;
55 }
56
57 public void setSelectItems(SelectItem[] selectItems)
58 {
59 if (selectItems == null) throw new NullPointerException("selectItems");
60 _selectItems = selectItems;
61 }
62 }