KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > swing > table > TableModelFilter


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.swing.table;
8
9 import javax.swing.event.TableModelEvent JavaDoc;
10 import javax.swing.table.TableModel JavaDoc;
11
12 /**
13  * @author Laurent Etiemble
14  * @version $Revision: 1.7 $
15  */

16 public abstract class TableModelFilter extends TableModelIndexed
17 {
18    /** Description of the Field */
19    protected int column = -1;
20    /** Description of the Field */
21    protected Object JavaDoc[] values;
22
23
24    /**
25     * Constructor for TableModelFilter.
26     *
27     * @param model
28     */

29    public TableModelFilter(TableModel JavaDoc model)
30    {
31       super(model);
32    }
33
34
35    /**
36     * Description of the Method
37     *
38     * @param column Description of the Parameter
39     * @param value Description of the Parameter
40     */

41    public void filter(int column, Object JavaDoc value)
42    {
43       this.filter(column, new Object JavaDoc[]{value});
44    }
45
46
47    /** Description of the Method */
48    public abstract void filter();
49
50
51    /**
52     * Description of the Method
53     *
54     * @param column Description of the Parameter
55     * @param values Description of the Parameter
56     */

57    public void filter(int column, Object JavaDoc[] values)
58    {
59       this.column = column;
60       this.values = values;
61       this.filter();
62       super.tableChanged(new TableModelEvent JavaDoc(this));
63    }
64
65
66    /**
67     * Gets the column attribute of the TableModelFilter object
68     *
69     * @return The column value
70     */

71    public int getColumn()
72    {
73       return column;
74    }
75
76
77    /**
78     * Gets the values attribute of the TableModelFilter object
79     *
80     * @return The values value
81     */

82    public Object JavaDoc[] getValues()
83    {
84       return values;
85    }
86 }
87
Popular Tags