01: package org.wings.event;
02:
03: import org.wings.SComponent;
04: import org.wings.SFrame;
05:
06: /**
07: * This event is fired if the parent frame of a {@link SComponent} is modified.
08: * To receive these events register via {@link SComponent#addParentFrameListener(SParentFrameListener)}
09: *
10: * @author ole
11: * @author <a href="mailto:B.Schmid@eXXcellent.de">Benjamin Schmid</a>
12: */
13: public class SParentFrameEvent extends SComponentEvent {
14: /**
15: * The first number of used IDs for parentFrame events.
16: */
17: public static final int PARENTFRAME_FIRST = 11100;
18:
19: /**
20: * An event with this ID indicates, that a component was added to
21: * the container.
22: */
23: public static final int PARENTFRAME_ADDED = PARENTFRAME_FIRST;
24:
25: /**
26: * An event with this ID indicates, that a component was removed from
27: * the container.
28: */
29: public static final int PARENTFRAME_REMOVED = PARENTFRAME_FIRST + 1;
30:
31: /**
32: * The last number of used IDs for container events.
33: */
34: public static final int PARENTFRAME_LAST = PARENTFRAME_REMOVED;
35:
36: /**
37: * the parent frame that has been added or removed.
38: */
39: private SFrame parentFrame;
40:
41: /**
42: * Event fired if parent frame of a component changes.
43: *
44: * @param modifiedComponent The {@link SComponent} whoose parent frame changed.
45: * @param eventType The type of modifcation (i.e. {@link #PARENTFRAME_ADDED} or {@link #PARENTFRAME_REMOVED}
46: * @param parentFrame
47: */
48: public SParentFrameEvent(SComponent modifiedComponent,
49: int eventType, SFrame parentFrame) {
50: super (modifiedComponent, eventType);
51: this .parentFrame = parentFrame;
52: }
53:
54: /**
55: * @return the parentFrame that has been added or removed.
56: */
57: public SFrame getParentFrame() {
58: return parentFrame;
59: }
60:
61: }
|