1 29 30 package nextapp.echo2.app.event; 31 32 import java.util.EventObject ; 33 import nextapp.echo2.app.table.TableModel; 34 35 38 public class TableModelEvent extends EventObject { 39 40 44 public static final int ALL_COLUMNS = -2; 45 46 51 public static final int HEADER_ROW = -1; 52 53 56 public static final int DELETE = 1; 57 58 61 public static final int INSERT = 2; 62 63 66 public static final int UPDATE = 3; 67 68 71 public static final int STRUCTURE_CHANGED = 4; 72 73 private int firstRow; 74 private int lastRow; 75 private int column; 76 private int type; 77 78 84 public TableModelEvent(TableModel source) { 85 this(source, ALL_COLUMNS, 0, Integer.MAX_VALUE, UPDATE); 86 } 87 88 95 public TableModelEvent(TableModel source, int row) { 96 this(source, ALL_COLUMNS, row, row, UPDATE); 97 } 98 99 107 public TableModelEvent(TableModel source, int firstRow, int lastRow) { 108 this(source, ALL_COLUMNS, firstRow, lastRow, UPDATE); 109 } 110 111 120 public TableModelEvent(TableModel source, int column, int firstRow, int lastRow) { 121 this(source, column, firstRow, lastRow, UPDATE); 122 } 123 124 144 public TableModelEvent(TableModel source, int column, int firstRow, int lastRow, int type) { 145 super(source); 146 147 this.firstRow = firstRow; 148 this.lastRow = lastRow; 149 this.column = column; 150 this.type = type; 151 } 152 153 158 public int getColumn() { 159 return column; 160 } 161 162 167 public int getFirstRow() { 168 return firstRow; 169 } 170 171 176 public int getLastRow() { 177 return lastRow; 178 } 179 180 192 public int getType() { 193 return type; 194 } 195 } 196 | Popular Tags |