01: /*
02: * Copyright 2004 The Apache Software Foundation.
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: */
16: package javax.faces.model;
17:
18: /**
19: * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
20: *
21: * @author Thomas Spiegl (latest modification by $Author: mbr $)
22: * @version $Revision: 512227 $ $Date: 2007-02-27 13:25:16 +0100 (Di, 27 Feb 2007) $
23: */
24: public class SelectItemGroup extends SelectItem {
25: private static final long serialVersionUID = 849845793056900213L;
26:
27: private static final SelectItem[] EMPTY_SELECT_ITEMS = new SelectItem[0];
28:
29: // FIELDS
30: private SelectItem[] _selectItems;
31:
32: // CONSTRUCTORS
33: public SelectItemGroup() {
34: super ();
35: _selectItems = EMPTY_SELECT_ITEMS;
36: }
37:
38: public SelectItemGroup(String label) {
39: super ("", label, null, false);
40: _selectItems = EMPTY_SELECT_ITEMS;
41: }
42:
43: public SelectItemGroup(String label, String description,
44: boolean disabled, SelectItem[] selectItems) {
45: super ("", label, description, disabled);
46: if (selectItems == null)
47: throw new NullPointerException("selectItems");
48: _selectItems = selectItems;
49: }
50:
51: // METHODS
52: public SelectItem[] getSelectItems() {
53: return _selectItems;
54: }
55:
56: public void setSelectItems(SelectItem[] selectItems) {
57: if (selectItems == null)
58: throw new NullPointerException("selectItems");
59: _selectItems = selectItems;
60: }
61: }
|