01: /*
02: *
03: * (c) Copyright 2004 con:cern development team.
04: *
05: * This file is part of con:cern (http://concern.org).
06: *
07: * con:cern is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU Lesser General Public License
09: * as published by the Free Software Foundation; either version 2.1
10: * of the License, or (at your option) any later version.
11: *
12: * Please see COPYING for the complete licence.
13: */
14: package org.wingx.table;
15:
16: import javax.swing.table.AbstractTableModel;
17: import java.util.*;
18:
19: /**
20: * @author hengels
21: */
22: public abstract class AbstractSortableTableModel extends
23: AbstractTableModel implements SortableTableModel {
24: Map sorts = new HashMap();
25:
26: public int getSort(int col) {
27: Integer order = (Integer) sorts.get(new Integer(col));
28: if (order == null) {
29: order = new Integer(SORT_NONE);
30: sorts.put(new Integer(col), order);
31: }
32: return order.intValue();
33: }
34:
35: public void setSort(int col, int order) {
36: sorts.put(new Integer(col), new Integer(order));
37: }
38: }
|