View Javadoc

1   /*
2    * $Id: CameliaEvent.java,v 1.18 2011/06/16 09:29:40 jbmeslin Exp $
3    * 
4    */
5   package org.rcfaces.core.event;
6   
7   import javax.faces.component.UIComponent;
8   import javax.faces.event.FacesEvent;
9   import javax.faces.event.FacesListener;
10  
11  import org.rcfaces.core.internal.listener.IScriptListener;
12  
13  /**
14   * @author Olivier Oeuillot (latest modification by $Author: jbmeslin $)
15   * @version $Revision: 1.18 $ $Date: 2011/06/16 09:29:40 $
16   */
17  abstract class CameliaEvent extends FacesEvent implements ITypedEvent {
18      private static final String REVISION = "$Revision: 1.18 $";
19  
20      private static final long serialVersionUID = -2844437297380361681L;
21  
22      protected final int type;
23  
24      public CameliaEvent(UIComponent component) {
25          this(component, 0);
26      }
27  
28      public CameliaEvent(UIComponent component, int type) {
29          super(component);
30  
31          this.type = type;
32      }
33  
34      public final int getType() {
35          return type;
36      }
37  
38      public boolean isAppropriateListener(FacesListener listener) {
39          if (listener instanceof IScriptListener) {
40              return false;
41          }
42  
43          return true;
44      }
45  
46  }