KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > selection > SingleSelectionModel


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.wcf.selection;
14
15 import com.tonbeller.wcf.controller.RequestContext;
16
17 /**
18  * SelectionModel for Tree and Table components.
19  *
20  * @author av
21  */

22 public interface SingleSelectionModel {
23   /**
24    * return the only selected object or null if the selection is empty.
25    * @throws IllegalStateException if the selection contains more than one element
26    */

27   Object JavaDoc getSingleSelection();
28   
29   /**
30    * sets the only selected element
31    */

32   void setSingleSelection(Object JavaDoc selectedObject);
33
34   /**
35    * clears the selection
36    */

37   void clear();
38   
39   boolean isEmpty();
40   
41   /**
42    * true, if item is selectable. If not, no checkbox / radio button / hyperlink will be generated
43    */

44   boolean isSelectable(Object JavaDoc item);
45
46   /**
47    * fires a SelectionChangeEvent. This is not fired automatically
48    * so clients may choose when to notify the listeners (e.g. after a
49    * couple of changes have been made).
50    * @param context
51    */

52   void fireSelectionChanged(RequestContext context);
53   void addSelectionListener(SelectionChangeListener l);
54   void removeSelectionListener(SelectionChangeListener l);
55 }
56
Popular Tags