01: package com.xoetrope.awt;
02:
03: import java.util.Vector;
04:
05: import java.awt.Component;
06: import java.awt.Container;
07:
08: import net.xoetrope.builder.XuiBuilder;
09: import com.xoetrope.validation.XFormValidationFactory;
10: import net.xoetrope.xml.XmlElement;
11: import net.xoetrope.xui.XPage;
12: import net.xoetrope.xui.XProject;
13: import net.xoetrope.xui.XProjectManager;
14: import net.xoetrope.xui.validation.XValidationFactory;
15:
16: /**
17: * A builder of forms from an XML description. Extends XuiBuilder by adding
18: * support for repeated elements.
19: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
20: * the GNU Public License (GPL), please see license.txt for more details. If
21: * you make commercial use of this software you must purchase a commercial
22: * license from Xoetrope.</p>
23: * <p>$Revision: 1.5 $</p>
24: */
25: public class XFormBuilder extends XuiBuilder {
26: public XFormBuilder(XProject project) {
27: super (project);
28: }
29:
30: /**
31: * Construct a validation factory appropriate to this builder
32: * @param validationFileName the validations file to read
33: * @return the validation factory
34: */
35: protected XValidationFactory getValidationFactory(
36: String validationFileName) {
37: try {
38: XValidationFactory vf = (XValidationFactory) validationFactories
39: .get(validationFileName);
40: if (vf == null) {
41: vf = new XFormValidationFactory(currentProject);
42: validationFactories.put(validationFileName, vf);
43: }
44: return vf;
45: } catch (Exception ex) {
46: return null;
47: }
48: }
49: }
|