KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > component > event > ComponentEvent


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.component.event;
19
20 import java.util.EventObject JavaDoc;
21
22 /**
23  * <p>Sent to signify an event on the sending component.</p>
24  *
25  * Copyright 2003 Sapient
26  * @since carbon 2.0
27  * @author Greg Hinkle, March 2003
28  * @version $Revision: 1.4 $($Author: dvoet $ / $Date: 2003/05/05 21:21:12 $)
29  */

30 public class ComponentEvent extends EventObject JavaDoc {
31
32
33     /**
34      * The name of the event.
35      */

36     protected String JavaDoc name;
37
38     /**
39      * The message for the event.
40      */

41     protected String JavaDoc message;
42
43     /**
44      * Constructs a new component event. Used to send messages to those who
45      * may handle component events. Events are sent when a component has
46      * a configured decorator implementing the EventManager interface.
47      *
48      * @param source The source object for the event.
49      * @param eventName the name of the event.
50      * @param eventMessage a description of the event.
51      */

52     public ComponentEvent(Object JavaDoc source, String JavaDoc eventName,
53             String JavaDoc eventMessage) {
54
55         super(source);
56         this.name = eventName;
57         this.message = eventMessage;
58     }
59
60     /**
61      * Retrieves the name of the event.
62      * @return the name of the event.
63      */

64     public String JavaDoc getName() {
65         return name;
66     }
67
68     /**
69      * Retrieves the message for the event.
70      * @return the message for the event.
71      */

72     public String JavaDoc getMessage() {
73         return message;
74     }
75
76 }
77
Popular Tags