01: /*
02: * Copyright 2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 java.util.EventObject;
20:
21: import javax.faces.component.UIComponent;
22:
23: /**
24: * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
25: *
26: * @author Thomas Spiegl (latest modification by $Author: mbr $)
27: * @version $Revision: 512227 $ $Date: 2007-02-27 13:25:16 +0100 (Di, 27 Feb 2007) $
28: */
29: public abstract class FacesEvent extends EventObject {
30: // FIELDS
31: private PhaseId _phaseId;
32:
33: // CONSTRUCTORS
34: public FacesEvent(UIComponent uiComponent) {
35: super (uiComponent);
36: if (uiComponent == null)
37: throw new IllegalArgumentException("uiComponent");
38: _phaseId = PhaseId.ANY_PHASE;
39: }
40:
41: // METHODS
42: public abstract boolean isAppropriateListener(
43: FacesListener faceslistener);
44:
45: public abstract void processListener(FacesListener faceslistener);
46:
47: public UIComponent getComponent() {
48: return (UIComponent) getSource();
49: }
50:
51: public void queue() {
52: ((UIComponent) getSource()).queueEvent(this );
53: }
54:
55: public PhaseId getPhaseId() {
56: return _phaseId;
57: }
58:
59: public void setPhaseId(PhaseId phaseId) {
60: _phaseId = phaseId;
61: }
62: }
|