1 package pl.caltha.forms.internal.ui;
2
3 import org.xml.sax.Attributes;
4
5 import pl.caltha.forms.ConstructionException;
6 import pl.caltha.forms.internal.model.InstanceImpl;
7 import pl.caltha.forms.internal.model.SubmitInfo;
8
9 /***
10 * Represents ...
11 *
12 * @author <a href="mailto:zwierzem@ngo.pl">Damian Gajda</a>
13 * @version $Id: NodeForm.java,v 1.1 2005/01/19 06:55:28 pablo Exp $
14 */
15 public class NodeForm extends NodeSelectableContainer
16 {
17 public NodeForm(String type, Attributes atts)
18 throws ConstructionException
19 {
20 super(type, atts);
21 ref = new ReferenceSingleForm(atts, this);
22 }
23
24 /*** UI containing this form node. */
25 private UI ui;
26 /*** Connceted submit info. */
27 private SubmitInfo submitInfo;
28
29
30
31
32 /*** Returns actual page, depending on Instance. */
33 public NodeSelectable getPage(InstanceImpl instance)
34 {
35 return getCurrentChild(instance);
36 }
37
38
39
40 public String getMethod()
41 {
42 return submitInfo.getMethod();
43 }
44
45 public String getEnctype()
46 {
47 return submitInfo.getEncType();
48 }
49
50 public String getAcceptCharset()
51 {
52 return submitInfo.getEncoding();
53 }
54
55 public String getAcceptMIME()
56 {
57 return submitInfo.getMediaType();
58 }
59
60
61
62
63 public String getOnSubmit()
64 {
65
66 return null;
67 }
68
69 public String getOnReset()
70 {
71
72 return null;
73 }
74
75
76
77
78 /*** Inits a Node.
79 * @throws ConstructionException Thrown on initialisation errors
80 */
81 protected void init(UI ui)
82 throws ConstructionException
83 {
84 super.init(ui);
85 this.ui = ui;
86 submitInfo = ui.getForm().getSubmitInfo();
87 }
88 }
89