1 /*
2 * Copyright 2006-2016 The JGUIraffe Team.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License")
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package net.sf.jguiraffe.gui.builder.window.ctrl;
17
18 import net.sf.jguiraffe.gui.builder.event.BuilderEvent;
19
20 /**
21 * <p>
22 * A base class for events generated by {@link FormController}.
23 * </p>
24 * <p>
25 * {@link FormController} can fire several types of events, e.g. when a
26 * validation is performed. Interested objects can register themselves as
27 * listeners for these events. This class is the common base class for all
28 * events generated by the {@link FormController} class. It provides access to
29 * the {@link FormController} instance which is the source of this event.
30 * </p>
31 *
32 * @author Oliver Heger
33 * @version $Id: FormControllerEvent.java 205 2012-01-29 18:29:57Z oheger $
34 */
35 public class FormControllerEvent extends BuilderEvent
36 {
37 /**
38 * The serial version UID.
39 */
40 private static final long serialVersionUID = 20091209L;
41
42 /**
43 * Creates a new instance of {@code FormControllerEvent} and initializes it
44 * with the {@code FormController} which is the source of this event.
45 *
46 * @param source the source {@code FormController} (must not be <b>null</b>)
47 * @throws IllegalArgumentException if the controller is <b>null</b>
48 */
49 public FormControllerEvent(FormController source)
50 {
51 super(source);
52 }
53
54 /**
55 * Returns the {@code FormController} which generated this event.
56 *
57 * @return the {@code FormController} which is the source of this event
58 */
59 public FormController getFormController()
60 {
61 return (FormController) getSource();
62 }
63 }