KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Items


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 import javax.faces.model.SelectItem;
17 import javax.faces.model.SelectItemGroup;
18
19 import java.util.*;
20 /**
21  *
22  * @author Jijik
23  */

24 public class Items {
25     private List equipments = null;
26     
27     /** Creates a new instance of LanguageItems */
28     public Items() {
29         equipments = new ArrayList();
30
31         SelectItemGroup first = new SelectItemGroup("braking");
32         SelectItemGroup second = new SelectItemGroup("equipment");
33         
34         SelectItem[] array1 = {new SelectItem("abs"), new SelectItem("esp")};
35         SelectItem[] array2 = {new SelectItem("radio"), new SelectItem("gps"), new SelectItem("mobil set")};
36         
37         first.setSelectItems(array1);
38         second.setSelectItems(array2);
39         
40         equipments.add(first);
41         equipments.add(second);
42     }
43
44     public List getEquipments() {
45         return equipments;
46     }
47
48     public void setEquipments(List equipments) {
49         this.equipments = equipments;
50     }
51     
52 }
53
Popular Tags