KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > data > TabularValueChangeEvent


1 /*
2  * Created on 25.02.2005
3  *
4  */

5 package org.jdesktop.swing.data;
6
7 import java.util.EventObject JavaDoc;
8
9 /**
10  * Event fired by TabularDataModel on cell updates.
11  *
12  * PENDING: how to handle adding/removing rows?
13  *
14  * @author Jeanette Winzenburg
15  *
16  */

17 public class TabularValueChangeEvent extends EventObject JavaDoc {
18     
19
20     private int rowIndex;
21     private String JavaDoc fieldName;
22
23     /**
24      * Instantiates a change event for the cell given in
25      * rowIndex/fieldName coordinates.
26      *
27      * @param source
28      * @param rowIndex the row which is updated. -1 indicates all rows.
29      * @param fieldName the field which is updated. null indicates all fields.
30      */

31     public TabularValueChangeEvent(TabularDataModel source, int rowIndex, String JavaDoc fieldName) {
32         super(source);
33         this.rowIndex = rowIndex;
34         this.fieldName = fieldName;
35     }
36
37     /** the column coordinate.
38      *
39      * @return the column which is updated. null indicates all columns.
40      */

41     public String JavaDoc getFieldName() {
42         return fieldName;
43     }
44     
45     /**
46      *
47      * @return the rowIndex which is updated. -1 indicates all columns.
48      */

49     public int getRowIndex() {
50         return rowIndex;
51     }
52 }
53
Popular Tags