1 19 20 package org.netbeans.modules.xml.xam; 21 22 23 import java.util.EventObject ; 24 25 31 public class ComponentEvent extends EventObject { 32 static final long serialVersionUID = 1L; 33 34 private EventType event; 35 36 39 public ComponentEvent(Object source, EventType t) { 40 super(source); 41 event = t; 42 } 43 44 public enum EventType { 45 48 VALUE_CHANGED { 49 public void fireEvent(ComponentEvent evt, 50 ComponentListener l) { 51 l.valueChanged(evt); 52 }}, 53 56 CHILD_ADDED { 57 public void fireEvent(ComponentEvent evt, 58 ComponentListener l) { 59 l.childrenAdded(evt); 60 }}, 61 64 CHILD_REMOVED { 65 public void fireEvent(ComponentEvent evt, 66 ComponentListener l) { 67 l.childrenDeleted(evt); 68 }}; 69 70 public abstract void fireEvent(ComponentEvent evt, 71 ComponentListener l); 72 } 73 74 public EventType getEventType() { 75 return event; 76 } 77 78 public String toString() { 79 return event + ":" + source; 80 } 81 } 82 | Popular Tags |