1 16 package org.apache.cocoon.forms.formmodel.tree; 17 18 import org.apache.cocoon.forms.event.WidgetEvent; 19 20 25 public class TreeSelectionEvent extends WidgetEvent { 26 27 TreePath[] paths; 28 boolean [] isNew; 29 30 public TreeSelectionEvent(Tree source, TreePath path, boolean isNew) { 31 super(source); 32 this.paths = new TreePath[] { path }; 33 this.isNew = new boolean[] { isNew }; 34 } 35 36 public TreeSelectionEvent(Tree source, TreePath paths[], boolean areNew[]) { 37 super(source); 38 this.paths = paths; 39 this.isNew = areNew; 40 } 41 42 public TreeSelectionEvent(Tree source, TreePath paths[], boolean allNew) { 43 super(source); 44 this.paths = paths; 45 46 this.isNew = new boolean[paths.length]; 48 for (int i = 0; i < isNew.length; i++) { 49 this.isNew[i] = allNew; 50 } 51 } 52 53 public Tree getTree() { 54 return (Tree)super.getSource(); 55 } 56 57 60 public TreePath getPath() { 61 return this.paths[0]; 62 } 63 64 69 public boolean isAddedPath() { 70 return this.isNew[0]; 71 } 72 73 76 public TreePath[] getPaths() { 77 return this.getPaths(); 78 } 79 80 83 public boolean isAddedPath(int index) { 84 return this.isNew[index]; 85 } 86 } 87 | Popular Tags |