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.forms.FormValidatorResults;
19
20 /**
21 * <p>
22 * A specialized {@code FormControllerEvent} class that is generated when the
23 * controller performs a validation.
24 * </p>
25 * <p>
26 * Events of this type are sent to {@link FormControllerValidationListener}
27 * objects registered at a {@link FormController} whenever a validation
28 * operation was performed.
29 * </p>
30 *
31 * @author Oliver Heger
32 * @version $Id: FormControllerValidationEvent.java 205 2012-01-29 18:29:57Z oheger $
33 */
34 public class FormControllerValidationEvent extends FormControllerEvent
35 {
36 /**
37 * The serial version UID.
38 */
39 private static final long serialVersionUID = 20091209L;
40
41 /** The validation results. */
42 private final transient FormValidatorResults validationResults;
43
44 /**
45 * Creates a new instance of {@code FormControllerValidationEvent} and
46 * initializes it with the {@code FormController} that is the source of this
47 * event and the results of the validation operation.
48 *
49 * @param source the source {@code FormController} (must not be <b>null</b>)
50 * @param results the results of the validation operation (must not be
51 * <b>null</b>)
52 * @throws IllegalArgumentException if a required parameter is missing
53 */
54 public FormControllerValidationEvent(FormController source,
55 FormValidatorResults results)
56 {
57 super(source);
58 if (results == null)
59 {
60 throw new IllegalArgumentException(
61 "Validation results must not be null!");
62 }
63
64 validationResults = results;
65 }
66
67 /**
68 * Returns the {@code FormValidatorResults} object with the results of the
69 * validation operation.
70 *
71 * @return the {@code FormValidatorResults} object
72 */
73 public FormValidatorResults getValidationResults()
74 {
75 return validationResults;
76 }
77 }