1 7 package org.ejtools.swing.table; 8 9 import javax.swing.event.TableModelEvent ; 10 import javax.swing.table.TableModel ; 11 12 16 public abstract class TableModelFilter extends TableModelIndexed 17 { 18 19 protected int column = -1; 20 21 protected Object [] values; 22 23 24 29 public TableModelFilter(TableModel model) 30 { 31 super(model); 32 } 33 34 35 41 public void filter(int column, Object value) 42 { 43 this.filter(column, new Object []{value}); 44 } 45 46 47 48 public abstract void filter(); 49 50 51 57 public void filter(int column, Object [] values) 58 { 59 this.column = column; 60 this.values = values; 61 this.filter(); 62 super.tableChanged(new TableModelEvent (this)); 63 } 64 65 66 71 public int getColumn() 72 { 73 return column; 74 } 75 76 77 82 public Object [] getValues() 83 { 84 return values; 85 } 86 } 87 | Popular Tags |