01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
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;
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 {
30: private String column;
31:
32: private boolean order;
33:
34: /**
35: *
36: */
37: public SortingStateObservable() {
38: super ();
39: }
40:
41: /**
42: * @return
43: */
44: public String 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 string, boolean order) {
59: column = string;
60: this.order = order;
61:
62: setChanged();
63:
64: notifyObservers();
65: }
66: }
|