KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > alt > jiapi > event > FieldEvent


1 /*
2  * Copyright(C) 2001 Mika Riekkinen, Joni Suominen
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or(at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package alt.jiapi.event;
20
21 import java.util.EventObject JavaDoc;
22
23 /**
24  * FieldEvent objects are used to identify fields that
25  * are accessed somehow.
26  *
27  * @author Mika Riekkinen
28  * @author Joni Suominen
29  * @version $Revision: 1.4 $ $Date: 2002/03/20 12:00:32 $
30  */

31 public class FieldEvent extends JiapiEvent {
32     /**
33      * Constant used as an id of the FieldEvent
34      */

35     public static final int FIELD_SET = 1;
36
37     /**
38      * Constant used as an id of the FieldEvent
39      */

40     public static final int FIELD_GET = 2;
41
42
43     /**
44      * Constructor.
45      *
46      * @param fep An instance of FieldEventProducer.
47      * @param sourceObject A Source Object. On static methods, this
48      * is the <code>Class</code>, that method belongs to.
49      * Otherwise Source Object is '<code>this</code>'.
50      * @param fieldName Name of the Field that triggered this event
51      * @param id FIELD_SET or FIELD_GET values should be used
52      */

53     public FieldEvent(FieldEventProducer fep, Object JavaDoc sourceObject,
54                       String JavaDoc fieldName, int id) {
55         super(fep, sourceObject, fieldName, null, id);
56     }
57
58     /**
59      * Constructor.
60      *
61      * @param fep An instance of FieldEventProducer.
62      * @param sourceObject A Source Object. On static methods, this
63      * is the <code>Class</code>, that method belongs to.
64      * Otherwise Source Object is '<code>this</code>'.
65      * @param fieldName Name of the Field that triggered this event
66      * @param target
67      * @param id FIELD_SET or FIELD_GET values should be used
68      */

69     public FieldEvent(FieldEventProducer fep, Object JavaDoc sourceObject,
70                       String JavaDoc fieldName, Object JavaDoc target, int id) {
71         super(fep, sourceObject, fieldName, target, id);
72     }
73
74
75     /**
76      * Gets the name of the field, that triggered this event.
77      */

78     public String JavaDoc getFieldName() {
79         return super.getTargetName();
80     }
81 }
82
83
84
Popular Tags