View Javadoc

1   /***
2    Copyright (C) 2005 The Java Community
3   
4    This program is free software; you can redistribute it and/or modify  it under
5    the terms of the GNU General Public License as published by  the Free Software
6    Foundation; either version 2 of the License, or  (at your option) any later
7    version.
8   
9    This program is distributed in the hope that it will be useful,  but WITHOUT
10   ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS
11   FOR A PARTICULAR PURPOSE. See the  GNU General Public License for more details.
12  
13   You should have received a copy of the GNU General Public License  along with
14   this program; if not, write to the Free Software  Foundation, Inc., 59 Temple
15   Place, Suite 330, Boston, MA 02111-1307 USA.
16  
17   */
18  
19  package org.bejug.javacareers.jobs.view.jsf.model;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  import javax.faces.model.ArrayDataModel;
25  import javax.faces.model.DataModel;
26  
27  import org.bejug.javacareers.jobs.view.jsf.util.ItemsSorter;
28  
29  /***
30   * The Item JSf data.
31   *
32   * @author Peter Symoens (last modified by $Author: schauwvliege $)
33   * @version $Revision: 1.1 $ - $Date: 2005/08/24 16:30:03 $
34   */
35  public class ItemData {
36  
37      /***
38       * The filtered item model.
39       */
40      private DataModel filterModel;
41  
42      /***
43       * The items list.
44       */
45      private static List items = new ArrayList();
46  
47      /***
48       * @param itemsList
49       *            The jobOffers to set filled by the jobAction.
50       */
51      public static void setItems(List itemsList) {
52          items = itemsList;
53      }
54  
55     /***
56      *
57      * @return items Returns the itemlist.
58      */
59      public static List getItemsList(){
60          return items;
61      }
62  
63      /***
64       *
65       * @return Returns the dataModel
66       */
67      public DataModel getItems() {
68          ArrayDataModel model = new ArrayDataModel(items.toArray());
69  
70          if (filterModel == null) {
71              filterModel = new ItemsSorter(model);
72          }
73  
74          return filterModel;
75      }
76  }
77  /***
78   * $Log: ItemData.java,v $
79   * Revision 1.1  2005/08/24 16:30:03  schauwvliege
80   * introduction of mixed list of all items
81   *
82   *
83   */