1 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 37 public class TabChangeEvent 38 extends FacesEvent 39 { 40 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 |