1 19 20 package org.netbeans.modules.xml.xam.ui.search; 21 22 import java.util.EventObject ; 23 import java.util.List ; 24 25 31 public class SearchEvent extends EventObject { 32 33 private static final long serialVersionUID = 1L; 34 35 private List <Object > results; 36 37 private Type type; 38 39 private SearchException exception; 40 41 44 public static enum Type { 45 COMMENCED { 46 public void fireEvent(SearchEvent e, SearchListener l) { 47 l.searchCommenced(e); 48 } 49 }, 50 DISMISSED { 51 public void fireEvent(SearchEvent e, SearchListener l) { 52 l.searchDismissed(e); 53 } 54 }, 55 FAILED { 56 public void fireEvent(SearchEvent e, SearchListener l) { 57 l.searchFailed(e); 58 } 59 }, 60 FINISHED { 61 public void fireEvent(SearchEvent e, SearchListener l) { 62 l.searchFinished(e); 63 } 64 }; 65 66 72 public abstract void fireEvent(SearchEvent e, SearchListener l); 73 } 74 75 81 public SearchEvent(Object src, Type type) { 82 super(src); 83 this.type = type; 84 } 85 86 93 public SearchEvent(Object src, Type type, List <Object > results) { 94 this(src, type); 95 this.results = results; 96 } 97 98 105 public SearchEvent(Object src, Type type, SearchException error) { 106 this(src, type); 107 this.exception = error; 108 } 109 110 115 public SearchException getException() { 116 return exception; 117 } 118 119 124 public List <Object > getResults() { 125 return results; 126 } 127 128 133 public Type getType() { 134 return type; 135 } 136 } 137 | Popular Tags |