01: package org.wingx.table;
02:
03: import javax.swing.table.AbstractTableModel;
04: import java.util.Map;
05: import java.util.HashMap;
06:
07: /**
08: * @author hengels
09: */
10: public abstract class XTableModel extends AbstractTableModel implements
11: SortableTableModel, FilterableTableModel {
12: Map filters = new HashMap();
13:
14: public Object getFilter(int col) {
15: return filters.get(new Integer(col));
16: }
17:
18: public void setFilter(int col, Object value) {
19: filters.put(new Integer(col), value);
20: }
21:
22: Map sorts = new HashMap();
23:
24: public int getSort(int col) {
25: Integer order = (Integer) sorts.get(new Integer(col));
26: if (order == null) {
27: order = new Integer(SORT_NONE);
28: sorts.put(new Integer(col), order);
29: }
30: return order.intValue();
31: }
32:
33: public void setSort(int col, int order) {
34: sorts.put(new Integer(col), new Integer(order));
35: }
36: }
|