KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > tabbedpane > TabChangeEvent


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 package org.apache.myfaces.custom.tabbedpane;
17
18 import javax.faces.component.UIComponent;
19 import javax.faces.event.FacesEvent;
20 import javax.faces.event.FacesListener;
21 import javax.faces.event.PhaseId;
22
23 /**
24  * @author Manfred Geiler (latest modification by $Author: matze $)
25  * @version $Revision: 1.4 $ $Date: 2004/10/13 11:50:58 $
26  * $Log: TabChangeEvent.java,v $
27  * Revision 1.4 2004/10/13 11:50:58 matze
28  * renamed packages to org.apache
29  *
30  * Revision 1.3 2004/07/01 21:53:05 mwessendorf
31  * ASF switch
32  *
33  * Revision 1.2 2004/04/06 15:32:14 manolito
34  * correct phase is APPLY_REQUEST_VALUES
35  *
36  */

37 public class TabChangeEvent
38         extends FacesEvent
39 {
40     //private static final Log log = LogFactory.getLog(TabChangeEvent.class);
41

42     private int _oldTabIndex;
43     private int _newTabIndex;
44
45     public TabChangeEvent(UIComponent component, int oldTabIndex, int newTabIndex)
46     {
47         super(component);
48         _oldTabIndex = oldTabIndex;
49         _newTabIndex = newTabIndex;
50         setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
51     }
52
53     public int getOldTabIndex()
54     {
55         return _oldTabIndex;
56     }
57
58     public int getNewTabIndex()
59     {
60         return _newTabIndex;
61     }
62
63     public boolean isAppropriateListener(FacesListener listener)
64     {
65         return listener instanceof TabChangeListener;
66     }
67
68     public void processListener(FacesListener listener)
69     {
70         ((TabChangeListener)listener).processTabChange(this);
71     }
72
73 }
74
Popular Tags