1 24 package org.riotfamily.forms.event; 25 26 import java.util.List ; 27 28 29 30 31 32 35 public class EventPropagation { 36 37 public static final String ON_CLICK = "click"; 38 39 public static final String ON_CHANGE = "change"; 40 41 private String id; 42 43 private String type; 44 45 public EventPropagation(String id, String type) { 46 this.id = id; 47 this.type = type; 48 } 49 50 public String getId() { 51 return id; 52 } 53 54 public String getType() { 55 return type; 56 } 57 58 public static void addPropagations(JavaScriptEventAdapter adapter, List list) { 59 int types = adapter.getEventTypes(); 60 if ((types & JavaScriptEvent.ON_CLICK) > 0) { 61 list.add(new EventPropagation(adapter.getId(), ON_CLICK)); 62 } 63 if ((types & JavaScriptEvent.ON_CHANGE) > 0) { 64 list.add(new EventPropagation(adapter.getId(), ON_CHANGE)); 65 } 66 } 67 68 } 69 | Popular Tags |