KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > event > FacesEvent


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package javax.faces.event;
18
19 import javax.faces.component.UIComponent;
20 import java.util.EventObject JavaDoc;
21 import java.io.Serializable JavaDoc;
22
23 /**
24   * @author Thomas Spiegl (latest modification by $Author: mwessendorf $)
25   * @version $Revision: 1.5 $ $Date: 2004/07/01 22:01:14 $
26 */

27 public abstract class FacesEvent extends EventObject JavaDoc
28     implements Serializable JavaDoc
29 {
30     // FIELDS
31
private PhaseId _phaseId;
32
33     // CONSTRUCTORS
34
public FacesEvent(UIComponent uiComponent)
35     {
36         super(uiComponent);
37         if (uiComponent == null) throw new IllegalArgumentException JavaDoc("uiComponent");
38         _phaseId = PhaseId.ANY_PHASE;
39     }
40
41     // METHODS
42
public abstract boolean isAppropriateListener(FacesListener faceslistener);
43
44     public abstract void processListener(FacesListener faceslistener);
45
46     public UIComponent getComponent()
47     {
48         return (UIComponent)getSource();
49     }
50
51     public void queue()
52     {
53         ((UIComponent)getSource()).queueEvent(this);
54     }
55
56     public PhaseId getPhaseId()
57     {
58         return _phaseId;
59     }
60
61     public void setPhaseId(PhaseId phaseId)
62     {
63         _phaseId = phaseId;
64     }
65 }
66
Popular Tags