1 package com.teamkonzept.webman.mainint.events; 2 3 import java.util.*; 4 5 import com.teamkonzept.web.*; 6 7 11 public abstract class DefaultEventDistributor implements TKEventHandler 12 { 13 protected Vector handlerList = new Vector(); 14 15 public void handleEvent(TKEvent evt) throws com.teamkonzept.lib.TKException 16 { 17 for (int i = 0; i < handlerList.size(); i++) 18 { 19 TKEventHandler handler = (TKEventHandler)handlerList.elementAt(i); 20 if (handler.isHandler(evt)) 21 handler.handleEvent(evt); 22 if (evt.isConsumed()) 23 break; 24 } 25 } 26 27 public abstract boolean isHandler(TKEvent evt); 28 29 public void addEventHandler(TKEventHandler handler) 30 { 31 handlerList.addElement(handler); 32 } 33 34 public void removeEventHandler(TKEventHandler handler) 35 { 36 handlerList.removeElement(handler); 37 } 38 39 40 public void setHandleEvents(TKEvent[] events) 41 {} 42 43 44 public TKEvent[] getHandleEvents() 45 { 46 return null; 47 } 48 49 55 public TKEvent createEvent (TKHttpInterface http) 56 { 57 return null; 58 } 59 60 } 61 | Popular Tags |