1 16 package org.apache.myfaces.custom.tree.event; 17 18 import javax.faces.event.FacesEvent; 19 import javax.faces.event.FacesListener; 20 import javax.faces.component.UIComponent; 21 22 import org.apache.myfaces.custom.tree.model.TreePath; 23 24 25 44 public class TreeSelectionEvent extends FacesEvent 45 { 46 47 private TreePath oldSelectionPath; 48 private TreePath newSelectionPath; 49 50 51 58 public TreeSelectionEvent(UIComponent uiComponent, TreePath oldSelectionPath, TreePath newSelectionPath) 59 { 60 super(uiComponent); 61 this.oldSelectionPath = oldSelectionPath; 62 this.newSelectionPath = newSelectionPath; 63 } 64 65 66 71 public TreePath getOldSelectionPath() 72 { 73 return oldSelectionPath; 74 } 75 76 77 82 public TreePath getNewSelectionPath() 83 { 84 return newSelectionPath; 85 } 86 87 88 public boolean isAppropriateListener(FacesListener faceslistener) 89 { 90 return faceslistener instanceof TreeSelectionListener; 91 } 92 93 94 public void processListener(FacesListener faceslistener) 95 { 96 ((TreeSelectionListener) faceslistener).valueChanged(this); 97 } 98 } 99 | Popular Tags |