KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > table > SortingStateObservable


1 //The contents of this file are subject to the Mozilla Public License Version 1.1
2
//(the "License"); you may not use this file except in compliance with the
3
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
4
//
5
//Software distributed under the License is distributed on an "AS IS" basis,
6
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7
//for the specific language governing rights and
8
//limitations under the License.
9
//
10
//The Original Code is "The Columba Project"
11
//
12
//The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14
//
15
//All Rights Reserved.
16
package org.columba.mail.gui.table;
17
18 import java.util.Observable JavaDoc;
19
20 /**
21  * This is the model which handles the selected sorting column and the sorting
22  * order (ascending/descending) of the table
23  * <p>
24  * The sorting state submenu registers interest on this observable to change its
25  * selection state.
26  *
27  * @author fdietz
28  */

29 public class SortingStateObservable extends Observable JavaDoc {
30     private String JavaDoc column;
31
32     private boolean order;
33
34     /**
35      *
36      */

37     public SortingStateObservable() {
38         super();
39     }
40
41     /**
42      * @return
43      */

44     public String JavaDoc getColumn() {
45         return column;
46     }
47
48     /**
49      * @return
50      */

51     public boolean isOrder() {
52         return order;
53     }
54
55     /**
56      * @param string
57      */

58     public void setSortingState(String JavaDoc string, boolean order) {
59         column = string;
60         this.order = order;
61
62         setChanged();
63
64         notifyObservers();
65     }
66 }
Popular Tags