1 14 package org.wings.event; 15 16 import org.wings.SComponent; 17 import org.wings.SContainer; 18 19 26 public class SContainerEvent extends SComponentEvent { 27 30 public static final int CONTAINER_FIRST = 11000; 31 32 36 public static final int COMPONENT_ADDED = CONTAINER_FIRST; 37 38 42 public static final int COMPONENT_REMOVED = CONTAINER_FIRST + 1; 43 44 47 public static final int CONTAINER_LAST = COMPONENT_REMOVED; 48 49 52 private final SComponent child; 53 54 65 public SContainerEvent(SContainer source, int id, SComponent child) { 66 super(source, id); 67 this.child = child; 68 } 69 70 73 public SContainer getContainer() { 74 return (SContainer) source; 75 } 76 77 81 public SComponent getChild() { 82 return child; 83 } 84 85 public String paramString() { 86 switch (id) { 87 case COMPONENT_ADDED: 88 return "COMPONENT_ADDED"; 89 case COMPONENT_REMOVED: 90 return "COMPONENT_REMOVED"; 91 default: 92 return super.paramString(); 93 } 94 } 95 96 public String toString() { 97 return "ContainerEvent[container=" + source + "; " + paramString() + 98 "child=" + child + "]"; 99 } 100 } 101 102 103 | Popular Tags |