KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > navigator > member > MemberSelectionModel


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.navigator.member;
14
15 import java.util.List JavaDoc;
16
17 import com.tonbeller.jpivot.olap.model.Member;
18 import com.tonbeller.wcf.selection.DefaultSelectionModel;
19
20 /**
21  * A SelectionModel that allows only <code>Members</code> to be selected.
22  * The Model may contain objects of other types but only Members are
23  * selectable.
24  * @author av
25  */

26 public class MemberSelectionModel extends DefaultSelectionModel {
27   
28   List JavaDoc orderedSelection;
29
30   /**
31    * Constructor for MemberSelectionModel.
32    */

33   public MemberSelectionModel() {
34     super();
35   }
36
37   /**
38    * Constructor for MemberSelectionModel.
39    * @param mode
40    */

41   public MemberSelectionModel(int mode) {
42     super(mode);
43   }
44
45   /**
46    * true if item is a member
47    */

48   public boolean isSelectable(Object JavaDoc item) {
49     return super.isSelectable(item) && item instanceof Member;
50   }
51   
52   public void setOrderedSelection(List JavaDoc list) {
53     super.setSelection(list);
54     this.orderedSelection = list;
55   }
56
57   public List JavaDoc getOrderedSelection() {
58     return orderedSelection;
59   }
60
61 }
62
Popular Tags